Are there more tags out there that have syntax highlighting? I edited a couple of questions to add the programming tag but maybe sometimes it won't be necessary and it's a cool feature that all answers follow the question highlight.
The short answer to your question is to use this syntax:
<!-- language-all: lang-cpp --> right above the first block of code.
Here is an example of a question with the syntax highlighting "not working".
- Paste in the "html style" syntax as specified in the next image.
- Add 4 spaces.
- Give it a few seconds, then the highlighting should start working.
Using this method, all of the following code "blocks" will be treated as C++.
The long answer to your question is here: How Do I format my Code Blocks.