Source code header comments : Comments « Language « C Tutorial

Home
C Tutorial
1.Language
2.Data Type
3.String
4.printf scanf
5.Operator
6.Statement
7.Array
8.Function
9.Structure
10.Pointer
11.Memory
12.Preprocessor
13.File
14.Data Structure
15.Search Sort
16.Wide Character String
17.assert.h
18.ctype.h
19.math.h
20.setjmp.h
21.signal.h
22.stdio.h
23.stdlib.h
24.string.h
25.time.h
26.wctype.h
C / ANSI-C
C++
C++ Tutorial
Visual C++ .NET
C Tutorial » Language » Comments 
1.15.5.Source code header comments
  1. At the beginning of the program is a comment block.
  2. The comment block contains information about the program.
  3. Boxing the comments makes them stand out.

The some of the sections as follows should be included.

  1. Heading.
  2. Author.
  3. Purpose.
  4. Usage.
  5. References.
  6. File formats. A short description of the formats which will be used in the program.
  7. Restrictions.
  8. Revision history.
  9. Error handling.
  10. Notes. Include special comments or other information that has not already been covered.
/********************************************************           
    * hello -- program to print out "Hello World".         *   
    *                                                      *   
    * Author:  FirstName, LastName                         *   
    *                                                      *   
    * Purpose:  Demonstration of a simple program.         *   
    *                                                      *   
    * Usage:                                               *   
    *      Runs the program and the message appears.       *   
    ********************************************************/  

    #include <stdio.h> 
    int main() 
    {  

        /* Tell the world hello */ 
        printf("Hello World\n");   
        return (0);
    }
Hello World
1.15.Comments
1.15.1.Adding Comments
1.15.2.Using Comments to Disable
1.15.3.The comments are enclosed in '/*...*/'
1.15.4.The '//' is used as single line comment
1.15.5.Source code header comments
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.