The 1th part of the new understanding of C language
Layout and annotations of programs
In the "High Quality Programming Guide (c + + language)", the author said: The program can be likened to the layout of "calligraphy", good "calligraphy" can make people on the program at a glance, look cheerful. Indeed, when we open the program, the first thing we see is the layout of the program, our first impression is that the program is written neatly or messy. Said first impression is very important, in order to give everyone a good first impression, we must pay attention to the layout of the program.
In addition, good annotations can help readers understand the process more quickly and improve the efficiency of the work. Perhaps because of the busy work, many software engineers do not like to write notes for their own programs, that is not necessary to do so. So how would he feel if he gave him a code without any comment? In the program, graceful, proper annotation can play the role of icing on the cake, more can reflect the professional quality of an engineer. Therefore, it is necessary to write a note.
In the C language Program, the header file (. h file) and the implementation file (. c files) are generally included, and their layout and comments are as follows:
First, the layout and annotation of the header file.
The header file plays an auxiliary role, briefly reflecting the basic functions of the program.
In general, the layout of a header file can take the following style:
/***************************************************************
* Copyright (C) 2014, company name.
*
* File name:
* Content Summary:
* Other Description:
* Current Version:
Author
* Date of Completion:
*
* Modify the Record 1://Modify history, including modification date, version number, modification person and modification content, etc.
* Date Modified:
* Version number:
* Modified Person:
* Modify Content:
***************************************************************/
#ifndef _xxx_h//Prevent header files from being repeatedly referenced
#define _xxx_h
/**************************************************************
Related macro Definitions
**************************************************************/
/**************************************************************
Related structure body definition
**************************************************************/
/**************************************************************
Declaration of functions appearing in this program
**************************************************************/
#endif