Comments.


Lets start with a few examples.


  main()
  {

      int Counter=0;       /* Initalise Counter */

      /* a comment */

      /*
       * Another comment
       */

      /*****************
       *
       * Final comment.
       *
       *****************/ 
  }


A comment starts with a /* and ends with */. Comments started in this way can span multiple lines but cannot be nested. For example:


   main()
   {
       int Count = 0;           /* Initalise 
                                 * Counter to 0 */

       /* /* Invalid comment */ */
   }

This will give a syntax error, because the last line contains nested comments. C++ offers a solution to comment nesting.


C++ Extension Inline comments


Top Master Index Keywords Functions


Martin Leslie