Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Line Numbers in Visual C++

Status
Not open for further replies.

Rob0123456789

Programmer
Mar 24, 2003
4
US
Hi,
I'm sorry for the rudimentary nature of this question, but my help system is out of whack and I can't figure out how to turn on line numbers in my source code using VC++ 6.0. Can anyone help?
Thanks
 
Do you mean the line number showing up in the status bar? Do you have the status bar turned on?

-pete
 
Thanks for your reply palbano. What I meant was the line numbers appearing on the left-hand side of the editing window. Makes it much easier to debug when you can see the line numbers show up in your code. (I know clicking on the error message will take you to the line in question, but seeing line numbers in your code is still helpful.)
 
I don't believe i've ever turned that on. If you figure it out post the solution here will you?

-pete
 
In Visual Studio .NET 2003 go to:
Tools > Options... > (From the tree select) Text Editor > All Languages.
It should be there.
 
Thanks GMX. Unfortunately I'm using Visual C++ 6.0, not .NET. In the Tools->Options->Editor box there's no setting for line numbers.
 
Try looking in MSDN that's compatible with your version of VS.
 
when you are debugging with visual c++ on the debugging window,click the icon corresponding to disassembly.You should see a window with your code and the line numbers of each line on the left.
 
If you mean something like VB, which can compile with linenumbers and include the number in code, I guess you're out of luck. I'm afraid the VC compiler will freak when you add linenumbers in the editor.

You might want to check out the "#line" directive and "__LINE__" though....
Greetings,
Rick
 
No Lazyme, What I'm looking for is the edit option where line numbers appear in the left hand selection column, letting you know what the line number of the pgm is, not as a part of the pgm itself. I guess this is a rather outlandish thing to expect from VC++, though I program in a number of languages, and I've never seen an editor before that does not support line numbers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top