码迷,mamicode.com
首页 > 其他好文 > 详细

个人C++ 编码规范

时间:2015-09-21 19:24:07      阅读:127      评论:0      收藏:0      [点我收藏+]

标签:

(一)变量命名

 

  int  i为前缀

  int[]  arr为前缀

  int*  pi为前缀

  unsigend int   ui为前缀

  unsigend int*    pui为前缀

 

 

  short  s为前缀

  short*  ps为前缀

  unsigend short  us为前缀

  unsigend short*  pus为前缀

 

 

  long  l为前缀

  long*  pl为前缀

  unsigend long  ul为前缀

  unsigend long*  pul为前缀

 

 

  float  f为前缀

  float*  pf为前缀

  double  d为前缀

  double*  pd为前缀

 

  char  c为前缀

  char[]  sz为前缀

  char*  指向单个字符pc为前缀,指向字符串psz为前缀

 

  wchar_t  wc为前缀

  wchar_t[]  wsz为前缀

  wchar_t*  指向单个宽字符pwc为前缀,指向宽字符串pwsz为前缀

 

  string  str为前缀

  string[]  arrstr为前缀

  string*  pstr为前缀

 

  bool  b为前缀

  bool*  pb为前缀

 

  byte  by为前缀

  struct  st为前缀

  enum  em为前缀

  union  un为前缀

  dword  dw为前缀

  word  w为前缀

 

  vector  vec为前缀

  list   lst为前缀

  

  类成员变量  m_为前缀

  全局变量  g_为前缀

  静态变量  s_为前缀

  

 

  

  

  

个人C++ 编码规范

标签:

原文地址:http://www.cnblogs.com/smallcroco-blog/p/4826732.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!