程序的命名

1.1    文件命名

规则1:     文件命名应使用模块名的小写字母形式。禁止使用汉字或大、小写字母混用作为代码文件名。

  

前缀符

含义

例子

b

bool

bOK,bQuit,bFind

c、ch

char

cFlag,cBankType,chSubSystemType

s

char []

sSysName,sStaticName,sTimeStr

str

CString、String

strSysName, strStaticName, strTimeStr

by

unsign char []

byMacStr,bySendBuffer, bySrcBuffer

n、i

int

nCnt,nPort,nRetCode

l

long

lFileSize,lOffset,lCount

d

double

dAmount,dSumVal,dWrkVal

f

float

fAmount, fSumVal, fWrkVal

ui/ul

unsigned int/long

uiCnt, uiFileSize, ulRetCount

w

WORD

与unsigned int等价的32位整数

dw

DOUBLE WORD

与unsigned long等价的64位整数

em

枚举型变量

emDays, emColors, emSet

st

结构型编码

stSystem,stCtrlData, stSet

前缀符

含义

例子

g_

全局变量

g_stSystem, g_cMacType, g_strSysName

s_

静态变量

s_nCurCnt,s_strStaticName,s_pSysTime

m_

类数据成员

m_nBankType,m_sWrkBuffer, m_strMyName

h

句柄类变量

hnFileHandle,hnSocket,hpProcHandle

p

指针类变量

psReadBuff,pstrRetStr,ppTarget

a

数组类变量

anPorts,asSendBuffers,apWrkBuffs

posted @ 2014-01-22 17:32  Peaceful-蓝蓝的  阅读(363)  评论(0编辑  收藏  举报