This might appear silly, but I have been wondering for a while, how can I put code inside a comment in stackoverflow. I haven't been able to figure this out. I have seen users putting those grayish blocks in a comment.

@Ether - I tried doing this. Text wrapped in backquotes displays a gray block in question or answer, but in comments it displays a highlighted box. How do I get the grey box in a comment?
–
ShiVikJul 2 '10 at 2:23

@ShiVik: what dis the difference between a highlighted box and a grey box? Do they both use a monospaced font?
–
EtherJul 2 '10 at 2:24

Yes. highlighted box is just white in background, it appears hightlighted when I hover the mouse over the comment which has it. Grey box is always highlighted grey whether I hover mouse over it or not.
–
ShiVikJul 2 '10 at 2:31

Putting four spaces before the code will automatically generate the code block. Inside of a comment, you can wrap it with ` and it will demarcate the code. Or simply mark up the code that you want to be laid out as code and press the button with the 101010 label.

Stop with the down votes - this was migrated while i was in the middle of editing it!! What i was busy clarifying is that it isn't a full code block - you don't get syntax coloring etc, just the highlighted background.