What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 150 Stack Exchange communities.

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

1 Answer 1

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 stackoverflow.com for doing a superb job.

share|improve this answer

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