display line numbers

D

drew

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
 
H

Howard

drew said:
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
 
J

James Rafter

drew said:
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.
 
D

David Harmon

On Fri, 17 Dec 2004 17:41:49 GMT in comp.lang.c++, "drew"
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
 
J

James Rafter

drew said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,188
Messages
2,571,002
Members
47,591
Latest member
WoodrowBut

Latest Threads

Top