How Do You Add Colored Code in the Forums

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CodeTilYaDrop
    New Member
    • Aug 2007
    • 66

    How Do You Add Colored Code in the Forums

    I was wondering how some people have colored code and others do not. How do I get the colored code to show up in the forum? I think you can read it better. I was just curious so I can do it in the future. - SEOT
  • sanctus
    New Member
    • Mar 2007
    • 84

    #2
    Originally posted by CodeTilYaDrop
    I was wondering how some people have colored code and others do not. How do I get the colored code to show up in the forum? I think you can read it better. I was just curious so I can do it in the future. - SEOT
    Instead of typing only "code" in brackets at the beginning of your code you type "code=c"... for example
    Code:
    int i=0;
    for i= 0 ; i<4; i++
    {
    std::cout<<'this should have no colors'<<endl;
    }
    [code=c]
    int i=0;
    for (i= 0 ; i<4; i++)
    {
    std::cout<<'thi s should have colors'<<endl;
    }
    [/code]
    In case quote it and you see it...

    Comment

    • CodeTilYaDrop
      New Member
      • Aug 2007
      • 66

      #3
      I am not sure I understand. What you mean by typing "code=c"? Where do you type that at? Do you type "code=c" in the text box right before you type or copy your code in the text box??? - CTYD

      Comment

      • jabbah
        New Member
        • Nov 2007
        • 63

        #4
        just click on the "reply" at the end of sanctus' message. you will get a text box with a quote of sanctus' message. then you will see.

        besides you can as well do code=cpp.

        Comment

        • Ganon11
          Recognized Expert Specialist
          • Oct 2006
          • 3651

          #5
          If you are typing code in your response, we ask that you surround them with tags like this: [CODE]

          This produces the plain, black and white formatting you see. It is standard and can be used for any language. However, there is the possibility to get colored, formatted output specially for your language, such as C, C++, Java, etc. etc. In this case, you would manually go to the [CODE] tag and replace it with: [CODE=c], or [CODE=cpp], or [CODE=java], etc. etc.

          See also this section of our FAQ.

          Comment

          • CodeTilYaDrop
            New Member
            • Aug 2007
            • 66

            #6
            [code=c]
            #include <iosteam.h>


            int main()
            {
            cout << "Testing Color for Code" << endl;
            return 0;
            }
            [/code]

            Code:
             cout << "Testing Color for Code" << endl;
            Testing - CTYD

            Comment

            • CodeTilYaDrop
              New Member
              • Aug 2007
              • 66

              #7
              Got It You All! I appreciate your help like always! This will help me make my code a little easier to read next time I post! - CTYD

              Comment

              Working...