How to insert code into my post?

Document created by Monica Arvizu Employee on Mar 4, 2013
Version 1Show Document
  • View in full screen mode

Hello everyone!

 

If you are a regular user of Freescale Community (Hurray! ) you might have seen many posts with very useful code.

Maybe you have seen them just posted this way:

 

// C++ example

#include <iostream>
using namespace std;

int main ()
{
  cout << "Hello World!";
  return 0;
}

 

Pretty nice when we copy-paste and it comes out with the compiler colors right? But what if we run into the same code posted this way:

 

//C++ example

#include <iostream>

using namespace std;

int main()

{

cout<<"Hello world!";

return 0;

}

 

Not so pretty, and when it is a very large piece of code it might get really confusing.

 

Best case scenario, you'll find the code as it follows:

 

//C++ example
#include <iostream>
using namespace std;
int main()
{
cout<<"Hello World!";
return 0;
}

 

And why is that a "best case scenario" you wonder?

Well, among the tools we can find when creating posts, documents or any content within Community, there are some we rarely use that would improve the quality of our posting by optimizing space, organizing our ideas and making it easier and clearer for those who read us.

 

Have never used this code feature? Check it out!

code1.png

 

You'll find a list box from which you'll be able to choose several types of code.

I chose the C++ option as an example.

 

The next thing you'll get will be a set of numbered rows that will recognize the syntax and commands according to the code you're posting in.

Now that you know of it you won't have a post made without it, will you?

Attachments

    Outcomes