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

Possible Duplicate:
How do I format my code blocks?

I see again and again that people here ask questions very ably — their code looks like real code, all the tags are in one color and all the commands are in another color. But I don't even know how to change the color of text while typing my question — obviously, there is no such tool here (at least I couldn't find one) - let alone format the code properly. How do I do that here at Stack Overflow?

share|improve this question

migrated from stackoverflow.com Nov 10 '09 at 11:01

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

marked as duplicate by ChrisF, Pops, random Nov 15 '11 at 15:36

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.

add comment

4 Answers

Click on the orange question mark above the top right corner of the reply box. That will explain everything.

share|improve this answer
add comment

For code lines, put four spaces in front of them.

void foo(int bar) {
    // vomit
}

done. Simples. Oh, orange question mark surely is obvious too?

(The system uses MarkDown formatting).

share|improve this answer
add comment

Write your code, and then highlight it and use the 'code' button above the input box (that's the button consisting of { }).

share|improve this answer
add comment

You put four spaces at the beginning of the line to make it a code block.

You can select a part of your text and press the { } button to add/remove four spaces at the beginning of each line.

share|improve this answer
add comment

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