read :《 High-quality C++ Programming Guide 》

The author of “ In Hungary, ” The naming rules are reasonably simplified , The following naming rules are easy to use , It's more suitable for Windows Application software development .

【 The rules 3-2-1 Class and function names are combined with words starting with uppercase letters .

for example :

class Node; // Class name

class LeafNode; // Class name

void  Draw(void); // Function name

void  SetValue(int value); // Function name

【 The rules 3-2-2】 Variables and parameters are combined with words starting with lowercase letters .

for example :

BOOL flag;

int  drawMode;

【 The rules 3-2-3】 Constants are written in capital letters , Divide words with underscores .

for example :

const int MAX = 100;

const int MAX_LENGTH = 100;

【 The rules 3-2-4】 Prefix static variables s_( Express static).

for example :

void Init(…)

{

static int s_initValue; // Static variables

}

【 The rules 3-2-5】 If you have to, global variables , The global variables are prefixed g_( Express global).

for example :

int g_howManyPeople; // Global variables

int g_howMuchMoney; // Global variables

【 The rules 3-2-6】 Class's data members are prefixed m_( Express member), This can avoid the data member having the same name as the parameter of the member function .

for example :

void Object::SetValue(int width, int height)

{

m_width = width;

m_height = height;

}

【 The rules 3-2-7】 In order to prevent some identifiers in one software library from conflicting with those in other software libraries , You can prefix all kinds of identifiers with prefixes that reflect the nature of the software . For example, 3D graphics standards OpenGL All library functions of the gl start , All constants ( Or macro definition ) in GL start .

ordinary Windows More articles on application naming rules

  1. java Program naming rules

    Program naming rules prompt : The module designer determines the module naming rules of the software ( For example, class . function . Variable etc. ), Make sure that the style of the module design document is consistent with the style of the code . It can be extracted or quoted from the programming specification of the mechanism ( If it exists ). Naming rules 1. Package name      ...

  2. Microsoft The Hungarian naming rules for companies

    Microsoft The company's " In Hungary, " The French naming rules The more famous naming rules when pushing Microsoft The company's " In Hungary, " Law , The main idea of this naming rule is " Add... To variable and function names ...

  3. Reread the Golden Book ------ High-quality C Programming Guide ( Lin Rui )------- The third chapter Naming rules

      3.1  Common rules The rules : Identifiers should be intuitive and spellable , It can be translated into English . The rules : The length of the identifier needs to be controlled , It shouldn't be too long . The rules : The naming rules should be consistent with the operating system or development tools , For example, case mixing .AddChar ...

  4. Windows PE Basic introduction :Windows PE The role of 、 Naming rules 、 Starting mode 、 Start the principle

    Windows PE The full name is WindowsPreinstallationEnvironment(WinPE) Translate literally yes "Windows Preinstallation environment ". Microsoft's intention is :Win ...

  5. C++ Programming naming rules ( Reprint )

    Original address :http://www.cnblogs.com/ggjucheng/archive/2011/12/15/2289291.html If you want to effectively manage a slightly more complex system , A set of things for ...

  6. [ Reprint ]C++ Naming rules

    In the highly abstract and complex activity of software development , The importance of naming rules is particularly prominent . A well-defined and complete set of . The uniform naming standard used in the whole project will greatly improve the readability of the source code and the maintainability of the software . Before introducing the details , Let's start with ...

  7. C++ Programming naming rules

    Original address :http://www.cnblogs.com/ggjucheng/archive/2011/12/15/2289291.html If you want to effectively manage a slightly more complex system , A set of things for ...

  8. C++ Naming rules ( Reprinted for reference only )

    If you want to effectively manage a slightly more complex system , A set of unity for the things in it . With hierarchy . Clear naming rules are essential and very useful tools . Active in Biology . chemical . army . prison . underworld . A lot of knowledgeable people in terrorist organizations and other fields ...

  9. C++ Naming rules ( turn )

    If you want to effectively manage a slightly more complex system , A set of unity for the things in it . With hierarchy . Clear naming rules are essential and very useful tools . Active in Biology . chemical . army . prison . underworld . A lot of knowledgeable people in terrorist organizations and other fields ...

Random recommendation

  1. style="display" After that, you can't get offsetHeight or clientWidth The value of this kind of measurement

    If in html The element has style="display:none;height:90px;" After the attribute of , It's impossible to get offsetLeft ,offsetWidth,offsetTop, ...

  2. unity, The following two coroutines are not equivalent

    // Code 1 IEnumerator A(){ Debug.Log(“hi1”); { yield return new WaitForSeconds(1f); Debug.Log(“hi2”); } ...

  3. C/C++ Basic summary

    1 static( static state ) What does a variable do 3 The obvious role of the individual :1) In the body of the function , Static variables have “ memory ” function , That is, a static variable is declared and its value remains unchanged during the process of a function being called 2) In module , Its scope is limited , namely ...

  4. $this->success(' Registered successfully !');

    Used in the controller , Instead of using... In the template

  5. mul8_unsigned multipliter

    Li Yamin pays more attention to the training of hardware design ideas . His hardware design method is closer to the underlying hardware , Let's take a look at his design ideas :                                                      ...

  6. [Android] FileInputStream track

    1. Origin Need to track FileInputStream Of Read Of Nativie Realization , I started to take a detour ,Java Under the project of FileInputStream Realization and Android The implementation of the project is different . in addition ,http://b ...

  7. This application failed to start because it could not find or load the Qt platform plugin "xcb".

    linux According to the system Qt5 No compiled program installed Qt In this system, the following error will be reported : This application failed to start because it could not find or ...

  8. Spring Boot Series of tutorials 17-Cache- cache

    cache A cache is a buffer for data exchange ( Referred to as Cache), When a piece of hardware wants to read data , It will first find the required data from the cache , If it is found, execute it directly , If you can't find it, you can find it in memory . Because cache runs much faster than memory , So the function of cache is to help ...

  9. IOS Development -UI Study - Use code to create button

    Use code to create button branch 5 A step , Namely : 1. Define a button , It can be defined as local variable or global variable according to the definition position : 2. Initialize button , Generally, a rectangle is used to initialize : 3. Set other properties of the button control , Such as the background picture , Or back ...

  10. FTP:500 OOPS: failed to open vsftpd log file:/var/log/vsftpd.log

    as follows : from 10.12.8.165 FTP To 10.1.3.34, newspaper failed to open vsftpd log[a4_csbdc@localhost ~]$ ftp  10.1.3.34Conn ...