Comments

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • beck322
    New Member
    • Jan 2007
    • 12

    Comments

    What is the difference between // and /* style comments?
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    Strictly speaking // comments are C++ and C compilers do not support them. However many (but not all) C compilers today do support them.

    // is a single line comment, the comment ends at the end of the line

    /* ... */ has a comment closing mark and can span more than 1 line. The comment ends at the closing marker */ Because of this it is slightly more susceptable to error from accidentally nesting comments.

    Comment

    • beck322
      New Member
      • Jan 2007
      • 12

      #3
      Originally posted by Banfa
      Strictly speaking // comments are C++ and C compilers do not support them. However many (but not all) C compilers today do support them.

      // is a single line comment, the comment ends at the end of the line

      /* ... */ has a comment closing mark and can span more than 1 line. The comment ends at the closing marker */ Because of this it is slightly more susceptable to error from accidentally nesting comments.
      Thank you !!!

      What does the #include do?

      Comment

      • Banfa
        Recognized Expert Expert
        • Feb 2006
        • 9067

        #4
        You can find the answer to this and the other basic questions you are asking by

        looking in your text book

        looking in your compiler documentation

        performing a quick google search

        Comment

        • RedSon
          Recognized Expert Expert
          • Jan 2007
          • 4980

          #5
          Beck, its time for you to read a book about c/c++ programming.

          Here is a site to get you started:

          Comment

          Working...