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

  

  

  

  

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