C语言编码规范
USTB ROBOTEAM
//使用到的一些外部变量
/*-------------Definitions---------------*/
//一些#defines及具体的函数实现
(2)头文件描述
头文件一般包括了数据结构的定义,函数原形的说明,宏定义等,不许包含函数体和变量实体,
文件名使用缺省的后缀 .h ,头文件的注释可如下:
#ifndef MODEL_H
#define MODEL_H
/***********************************************************
Module Name: model.h
Module Date: month/day/year
Module Auth: your name
Description: a short introduction of this module.
Revision History:
Date Rel Ver. Notes
month/day/year x.x [e.g.] Module created
***********************************************************/
/*----------------Includes---------------*/
//the head files that were included
//[e.g.] #include "head.h"
/*---------Structures and Typedefs-------*/
/*[e.g.] struct model{
char MemberOne;
int MemberTwo;
char MemberThree[3];
struct module *MemberFour;
}
enum BOOL {TRUE ,FALSE };
typedef struct module MODULE;
*/
/*---------------Defines-----------------*/
//[e.g.] #define MODLE 2
/*----------extern variables-------------*/
//the variables that were defined in other modules
//[e.g.] estern char ExternVariable;