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

Whenever I ask a question on Stack Overflow and I wish to respond when someone gives an answer, I only seem to have the option to add a comment.

How do I make a comment which is multi-lined, so I can reply back with code snippets or results, etc.?

share|improve this question
    
for example here is a comment I am adding , but if I try to add code, void helloWorld(void) { } it removes line breaks –  Ashod Apakian Nov 22 '12 at 9:25
    
void helloWorld(void) { } –  D J Nov 22 '12 at 9:28
    
say my question involved 10 lines of code, and someone made a response which I wanted to respond to with some of his code changed.. how do I do this for the 10 lines of code in question via the comment –  Ashod Apakian Nov 22 '12 at 9:31
    
Possibly related: meta.stackoverflow.com/questions/156606/code-in-comments –  Asad Nov 29 '12 at 18:12
add comment

migrated from stackoverflow.com Nov 29 '12 at 18:02

This question came from our site for professional and enthusiast programmers.

2 Answers

The ideal place for:

  1. Code snippets that clarify a detail in your code or why the code in an answer doesn't work
  2. Content that aggregates knowledge you have gleaned from the answers, without reaching a definitive solution

is your question.

Think of it this way: if the absence of the comment would mean the page loses something significant in terms of narrative clarity (how the OP and answerer got to the solution), or in terms of information present, then it probably doesn't belong in a comment anyway.

share|improve this answer
add comment

Multi-line comments are not supported.

Comments are second-class citizens, and should not be used for multi-line code examples. Use a pastebin service instead, or consider if you have just provided a full answer or an update to your post instead.

share|improve this answer
5  
Or in OP's case edit to update their question/answer with the code. –  user7116 Nov 29 '12 at 18:06
5  
-1 for pastebin - the information should be complete on SO and not need to go elsewhere –  Mark Nov 29 '12 at 18:14
    
@Mark: not in comments it doesn't need to be. –  Martijn Pieters Nov 29 '12 at 19:21
add comment

You must log in to answer this question.