Thursday, October 28, 2010

Posting a C++ code snippet

This question was asked on twitter.

So here is a basic code snippet:

#include <iostream>

void main() {
   cout << "Hello wolrd" << endl;
}

To be able to post this, all you need to do is, choose the new editor from "Settings->Basic -> Post Editor".
In the post options at the bottom of the Post Editor make sure, you have the "Show HTML literally" chosen in Compose Settings".

Extra tip: If you copy paste code from some website with nice formated colors, the code will show up exactly alike on your post.