1.基本概念 条件编译的行为类似于C语言中的if…else… 条件编译是预编译指示命令,用于控制是否编译某段代码 2.实例分析 条件编译初探 22-1.c #include <stdio.h> #define C 1 int main() { const char* s; #if( C == 1 ) s = "This is first printf...\n"; #else …
Qt for Android Qt for Android enables you to run Qt 5 applications Android devices. All Qt modules (essential and add-on) are supported except Qt WebEngine, Qt Serial Port, and the platform-specific ones (Qt Mac Extras, Qt Windows Extras, and Qt X11…
#include<stdio.h> #define LOCAL //无参宏 //条件编译 #ifdef LOCAL int a=1; #else int a=2; #endif #ifndef LOCAL int b=1; #else int b=2; #endif #define PI 3.1415926535 //有参宏 #define max_wrong(a,b) a>b?a:b #define max(a,b) ((a)>(b)?(a):(b)) #define maxwe…