项目文挡一《基本编码规范》

3 views
Skip to first unread message

percylee

unread,
Dec 13, 2005, 6:49:45 AM12/13/05
to cs的专栏 继续讨论区

这是一份基本规范的草稿示例,语言为c++,本专栏提供的项目编码均采用该规范。

/*
*.h
***********************************************************************************/

/*FileName:
*CreateDate:
*LastModifiedDate:
*Discription:
*Author:
*Checker:
**********************************************************************************/
#ifndef __XXX_H__
#define __XXX_H__

#include <iostream>
using namespace std;

// function or class body
class XXX
{
};


#endif //__XXX_H__


/*
*.cpp
*********************************************************************************/

//const var
const int VAR_NAME = 1024;

//global/local var
int varName = 1024;

//member var
class ClassName
{
int _varName;
};

//param var
int VarName = 1024;

//pointer val
int *pInt = NULL;

//enum val
enum EnumType
{
eVar1 = 0,
eVar2
};

//class/struct/namespace
class TypeName
{
public:
//member function
void current_date();
};

//inline/global function
inline void GetCurrentDate();

Reply all
Reply to author
Forward
0 new messages