What should I put in the header file?

xiaoxiao2021-03-30  213

The header file should be put:

# 1 function prototype declaration

# 2 The global variable declares that this is nothing to define. That is: Extern Int Global;

# 3 ourselves defined macros and types

The following is not to put it:

# 1 Definition of global variables and functions The global variable can only be defined once, if INT GLOBAL; in the header file, then all places containing this header file define a global variable global, when the link is connected I will report to find multiple Global. The situation of the function is also the truth, because the name of the function should be unique in the global space.

# 2 static variables and static functions This is also obvious, Static is originally to prevent global visible.

转载请注明原文地址:https://www.9cbs.com/read-130585.html

New Post(0)