Possibly a stupid m...
 

MegaSack DRAW - This year's winner is user - rgwb
We will be in touch

[Closed] Possibly a stupid markup question - how do I put code into the forum posts?

4 Posts
5 Users
0 Reactions
39 Views
Posts: 7090
Full Member
Topic starter
 

How do I put fixed-point code with proper indentation in to forum posts?

Just using "code" doesn't do the indentation:

[code]
if (foo)
bar(42);
[/code]

And is there any way to get language-specific syntax highlighting?


 
Posted : 14/01/2015 8:49 am
Posts: 43573
Full Member
 

That's all included in the new version of the forum


 
Posted : 14/01/2015 8:50 am
Posts: 1460
Full Member
 

If you wrap the code in backticks instead of < code> blocks it indents fine.

Syntax highlighting though... 😆

#include <stdio.h>

int main() {
  int i;
  for (i = 0; i < 10; i++) {
    printf("Hello oldnpastit\n");
  }
  return 0;
}

 
Posted : 14/01/2015 8:53 am
Posts: 10953
Free Member
 

You need one of these:

[img] [/img]

... what is code???


 
Posted : 14/01/2015 8:54 am
 JoeG
Posts: 0
Full Member
 

Works fine for me 😉

[img] [/img]


 
Posted : 14/01/2015 8:14 pm