previous | start | next

Inserting Comments

As noted above, comments should appear at the beginning of every C++ file you write for every C++ program.

There are two styles of comments. The compiler will ignore everything in a comment.

    1. Two forward slashes begin a comment that extends to the end of
       the current line:

       int count = 0; // This comment extends to end of this line

    2. A multiline comment begins with /* and terminates with the
       first occurence of */

        /*---------------------------------------------------
        | 
        |       File: prog1.cpp
        | 
        |       Description: Computes something...
        |       
        |       Created: 07 Sep 05
        |       Author: 
        +-------------------------------------------------*/
   


previous | start | next