By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,888 Members | 1,529 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,888 IT Pros & Developers. It's quick & easy.

display line numbers

P: n/a
I am reading my textbook and doing the code examples in MS Visual C++ 6.0
for my next class beginning Jan 05. The textbook examples show line numbers.
How do I get line numbers to show as I type in the examples? tia drew
Jul 22 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a

"drew" <dr*********@yahoo.com> wrote in message
news:xTEwd.1679$5m3.920@trndny04...
I am reading my textbook and doing the code examples in MS Visual C++ 6.0
for my next class beginning Jan 05. The textbook examples show line
numbers. How do I get line numbers to show as I type in the examples? tia
drew


That depends on the program you're editing your code in. None of the
editors I use show the lne numbers beside the code I'm writing (at least not
by default). That's possibly because line numbers are not relevant in C++.
In BASIC, they had meaning, but not in C++. The line number is often
displayed somewhere in the window, usually in a "stutus line" at the bottom
of the screen. But again, that depends entirely upon the editor (IDE) being
used, and what settings you choose for it.

Why do you need the line numbers? Just make your code look like the code in
the book. And remember, C++ does not (in most cases) care about the
formatting of the text. For example, the following code snippets are
identical:

for (int i = 0; i < N; ++i) { if (DoSomething(i)) DoSomethingElseToo(N);
else break; }

and...

for (int i = 0; i < N; ++i)
{
if (DoSomething( i ))
DoSomethingElseToo( N );
else
break;
}
So, line numbers really wouldn't help you much here, right? But if you
really want them, check the documentation for the program you're using to
edit your code, and see if that's an option.

-Howard
Jul 22 '05 #2

P: n/a
drew wrote:
I am reading my textbook and doing the code examples in MS Visual C++ 6.0 for my next class beginning Jan 05. The textbook examples show line numbers. How do I get line numbers to show as I type in the examples? tia drew


Of course this is off-topic in this group. But under the 'Tools Menu'
select 'Options...'. Click on the 'Text Editor' folder and then the
'All Languages' folder. There's a 'Line Numbers' check box.
This is VC 7.0 but 6.0 should be similar enough.

Jul 22 '05 #3

P: n/a
On Fri, 17 Dec 2004 17:41:49 GMT in comp.lang.c++, "drew"
<dr*********@yahoo.com> wrote,
I am reading my textbook and doing the code examples in MS Visual C++ 6.0
for my next class beginning Jan 05. The textbook examples show line numbers.
How do I get line numbers to show as I type in the examples? tia drew


That is a question not about C++ programming, which is the topic of
this newsgroup, but rather about how to drive the particular editor
you are using.

See the message posted twice per week in comp.lang.c++ under the
subject "Welcome to comp.lang.c++! Read this first." or available at
http://www.slack.net/~shiva/welcome.txt

Jul 22 '05 #4

P: n/a
http://www.wholetomato.com/ has an addon for Visual Studio that will
give you line numbers.
I don't know which version has it.

The product is not free however.

Jul 22 '05 #5

P: n/a
drew wrote:
I am reading my textbook and doing the code examples in MS Visual C++ 6.0 for my next class beginning Jan 05. The textbook examples show line numbers. How do I get line numbers to show as I type in the examples? tia drew


Of course this is off-topic in this group. But under the 'Tools Menu'
select 'Options...'. Click on the 'Text Editor' folder and then the
'All Languages' folder. There's a 'Line Numbers' check box.
This is VC 7.0 but 6.0 should be similar enough.

Jul 22 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.