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 I format my code blocks?

I'm newbie to Stack Overflow as well as programming. I just wanted to know what is the best way to attach a code to a question.

I know that indenting by 4 spaces treats a line as code .. but if I have a block of code then its becoming a pain to indent each and every line by four spaces. Blocking a set and pressing tab also does not seem to work. I know that I'm missing something here.

Just wanted experienced users to shed some light on this.

share|improve this question

migrated from stackoverflow.com Jun 26 '12 at 14:55

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

marked as duplicate by jadarnel27, amanaP lanaC A nalP A naM A, user7116, Shawn Chin, Al E. Jun 26 '12 at 15:32

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.

See How do I format my code blocks? – Martijn Pieters Jun 26 '12 at 14:58

1 Answer 1

Mark some text in the question/answer editor, then press the "code" button on the toolbar ({}). It will indent your selection as necessary.

share|improve this answer