Today, Shan Ge explained preprocessing, macro definition, array, and drawing, macro definition ....
Compile preprocessing: the work done before the source program is compiled. It is done by the Preprocessing Program. During compilation, the system will automatically reference the Preprocessing Program to process the preprocessing commands in the source program.
Preprocessing commands: commands starting.
# Define is a macro definition. Before the main function, data of the function type is defined. By default, only one row can be controlled, but multiple rows can be continued with the '\' extension, if you need to cancel the macro definition in the main application, you can use # UNDEF to cancel the following functions # define defined parameters.
# Define R/* # undef r */void main (void) {float C, r, s; printf ("Enter your value :"); scanf ("% F", & C); # ifdef RR = 3.14159 * C; printf ("macro definition: % F \ n", R ); # elses = C * C; printf ("cancelling macro definition % F \ n", S); # endif}
The assert macro is also an asserted function and can only be used in the debug version.
#include<assert.h>#include<stdio.h>#include<stdlib.h>structITEM{intkey;intvalue;};/*additemtolist,makesurelistisnotnull*/voidadditem(structITEM*itemptr){assert(itemptr!=NULL);/*additemtolist*/}intmain(void){additem(NULL);return0;}
Create your own database:
Create a user-defined function in the. h file and. M file, and then obtain the. h and. A files for third-party users. In this way, your source code can be stolen.
Array:
In C, arrays are constructed data types. An array can be divided into multiple array elements, which can be basic data type or constructor type. Therefore, Arrays can be divided into numeric arrays, character arrays, pointer arrays, Structured arrays, and other categories based on the types of array elements.
Summary of the sixth day of Camp David