Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

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.

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

share|improve this answer

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

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

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

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