Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 157 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

Possible Duplicate:
Why are there no line numbers in the code listings?

I want to display C++ code prepended with line numbers on Stack Overflow. The indented C++ code is formatted with Stack Overflow's built-in <!-- language: cpp --> tag.

I need this because gdb (gcc debugger on Linux) outputs the error for a certain line number in a C++ source file and the C++ code is quite long.

So I was just wondering, is it possible to display line numbers for C++ code posted and formatted on Stack Overflow?

share|improve this question

marked as duplicate by Robert Harvey Jun 24 '12 at 1:03

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

If this were implemented, it would have to include a capability to copy the code without the line numbers. Otherwise, it's a non-starter. – Robert Harvey Jun 24 '12 at 0:57
You are right. The coders who will read the post shouldn't have any difficulties reading the posting too. I agree with the policy made by stackoverflow. So the coding should be as minimum as one could. I saw this line numbering on other websites and copying is very cumbersome. At first I was wanting this feature for temporary convenience. But stackoverflow is right about this. – mvr950 Jun 24 '12 at 1:08
up vote 1 down vote accepted

Extremely sorry I didn't search properly before posting.

I found the answer here:

Why are there no line numbers in the code listings?

Line numbers in code

So it is better not to have line numbers. I agree 100% with stackoverflow's policy.

Thanks for doing a superb job.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged .