• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
SmallCroco
博客园    首页    新随笔    联系   管理    订阅  订阅

个人C++ 编码规范

(一)变量命名

 

  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_为前缀

  

 

  

  

  

posted @ 2015-09-21 17:24  SmallCroco  阅读(245)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3