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:
How do comments work?

How do I add code while writing comments and how do I enter a newline character?

share|improve this question

marked as duplicate by Michael Mrozek, Grace Note, Pops, Kev, ChrisF Jan 12 '11 at 20:43

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.

Writing what comments? Not sure I understand – Pëkka Jan 12 '11 at 18:41
While commenting to an answer / question.. When i hav to include a code sample, there s not formattin option lik available for asking a question – CHID Jan 12 '11 at 18:43
Like this: This is code. – John Jan 12 '11 at 18:44
You don't add newlines in comments. If you want to post that much code edit your question (or answer) or post an answer. – ChrisF Jan 12 '11 at 21:21

2 Answers 2

up vote 15 down vote accepted

You can't put newlines in a comment codeblock, but you can do inline code by using the backtick character. It looks like this


and it appears below the escape key on most keyboards which is sometimes the same key as the tilde (for example, on US English keyboards):


Surrounding something in backticks lets it appear as an "inline code block" and you could put them almost anywhere you like, even breaking across new lines. int c; c++; sprintf(); but notice there's no coloration, of course.

E.g. typing `something` in the editor produces something on the page

share|improve this answer
thank you. @drachenstern – CHID Jan 12 '11 at 18:46
Better to upvote or accept, but I'll take the thanks for now ;) – jcolebrand Jan 12 '11 at 18:47
is that the character Yes it works thank you ! – Faizan Dec 30 '12 at 13:22
testing thank you – Mansoorkhan Cherupuzha Aug 27 '14 at 10:28
test code not code – Marek Sep 23 '14 at 6:58
'something' this is a test – Tyler Nov 30 '14 at 12:07
~something~ this is another test – Tyler Nov 30 '14 at 12:08
one more time , cool – Tyler Nov 30 '14 at 12:08
this is just a test – kimreik Jan 11 at 0:54

Place this symbol: ` before and after the code. (On many keyboards, this "backtick" is the button to the left of "1".)

share|improve this answer
thank you. @john – CHID Jan 12 '11 at 18:46
@CHID: like drachenstern said, better to upvote or accept. ;) – John Jan 12 '11 at 18:48

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