Author Topic: How do you post a block of code  (Read 3814 times)

christruk42

  • Guest
How do you post a block of code
« on: March 16, 2021, 06:54:13 pm »
Downvote this;



I can't seem to do it, I'm using 'new reddit' so the four spaces format dosent work. I've heard you need to use 3 backticks. I tried doing it like this:



```



console.log('hi')



```



to no avail

Offline Suryavarman

  • Multiple posting newcomer
  • *
  • Posts: 81
    • Suryavarman
Re: How do you post a block of code
« Reply #1 on: March 16, 2021, 07:42:41 pm »
Code
#include <iostream>
#include <string>

int main()
{   
    std::cout << "you can use the BBCode."  << std::endl;
    std::cout << '[' << "CODE" << ']' << std::endl;
    std::cout << '[' << "\CODE" << ']' << std::endl;
   
    return 0;
}

« Last Edit: March 16, 2021, 07:45:37 pm by Suryavarman »

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: How do you post a block of code
« Reply #2 on: March 16, 2021, 07:44:37 pm »
You can use the button with a # over the emoticons or (code)Use square brackets instead of brackets(/code)