bug
#include <stdio.h> #define Project1 0x0 #define PROTECT_VERION Project1 int main() { int i; #if((PROTECT_VERION == Project2) || (PROTECT_VERION == Project3)) i = 3000; // 384 电池额定容量,单位100mAh #elif(PROTECT_VERION == Project1) i = 2000; // 384 电池额定容量,单位100mAh #else i = 1720; // 384 电池额定容量,单位100mAh #endif printf("Hello, World!\n"); printf("i = %d\n", i); return 0; }
$gcc -o main *.c
$main
Hello, World! i = 3000