2.2 Constants
The amount of the program does not change during operation. is given when initializing.
2.2.1 #define
2.2.2 Const
After the const modifier variable, the variable becomes constant.
Const and pointers are combined in a total of 4 forms
const int *p; P is a pointer to an int type of data. P is pointing to a constant.
int const *P; P is a pointer to an int type of data. P is pointing to a constant.
int *const p; P is a pointer to an int type of data. P itself is a constant, and p points to a variable.
const int *const *p; P is a pointer to an int type of data. P itself is a constant, and p points to a constant.
Const-type pointers are primarily used in string pointers.
2.2.3 Enum constant enum
Enumeration constants are a substitute for macro definitions and, in some cases, are more useful than macro definitions.
Introduction of 3.6 Header files
It is primarily used to collect declarations of functions and global variables.
#ifndef __a_h__
#define __a_h__
#endif __a_h__ is used to prevent duplicate inclusion of header files.
Do not define variables in the header file. The definition of a global variable is placed in a source file, and then used in a different source file before using the extern declaration.
C Language Learning Diary 7