Embedded C language of some special syntax

1

void may be used to define the type of null pointer, the pointer does not point to any type, but if necessary can be transformed into any type

2

Embedded C language at compile time, the program will first of a number of special commands pretreatment, and then pretreated with the results and then compile the source code

 

Pretreatments include "macros", "conditional compilation", "file contains a" three categories

 

Macro definitions:

#define PI 3.14   //用PI代替3.14
#define S(r) PI*r*r    //宏定义函数
#undef 宏名           //用于将定义好的宏名撤销

Conditional compilation:

#if  <表达式>    //若表达式成立
...

#else
...

#endif     //条件编译的结束标志



#ifdef    宏名    //如果宏被定义过,则编译以下程序
...

#ifndef   宏名    //如果宏没有被定义,则编译以下程序
...

File contains:

# include "文件名"      //在一个文件中,将另一个文件的全部内容包含进来

 

 

In addition:

typedef

It may be made to redefine the existing data types (from individual name)

Published 29 original articles · won praise 3 · Views 3382

Guess you like

Origin blog.csdn.net/qq_41601836/article/details/105118801