I click the Code button and it erases all the code I typed and won't let me type in the box any more.

I am getting realy annoyed trying to post c code because I can't add the curly brace... can someone please tell me what it takes to post code and don't tell me click the </> Code button... IT is not working for me.

Edited 2 Years Ago by gtcorwin

just type it out. Put a blank line before the code, make sure all of the code lines are indented with 4 spaces.

# I did not use the </>Code button.
print('Hello World.')

You can also use the tilde character (`) to do "inline code" such as this: int c = 5; ...for when you don't need a whole block.

Edited 2 Years Ago by chriswelborn: example.

OK thanks, this is a test post. It worked
Thanks!

for (int i=0;i<4;i++){
    do something with i;
}

The reply editor also has helpful buttons that will do this for you.

  1. Select your text and click either the Code or Inline Code button to apply formatting.

  2. Click the Code button to open an editor popup where you can paste your code. Submitting that will insert into the post a formatted code block with the contents.

  3. click the Inline Code button and a sample formatted section will be inserted into the post.

Edited 2 Years Ago by deceptikon

This question has already been answered. Start a new discussion instead.