1

这是我的程序中的条件之一:

if(Debug)fprintf(stdout,"Direction dir %d quot %d rem %0.2f %s\n",direction,quotient, remain, cardinal[quotient]);

我已经定义了所有内容并使用过stdlib.h,但它一直在返回

expected expression before ')' token

我在 ECLIPSE 中使用 minGW 编译器。编译如下:gcc -O0 -g3 -Wall -c -fmessage-length=0 -o wind_direction.o "..\\wind_direction.c"

4

1 回答 1

4

可能你有:

#define Debug   

With 适用于条件编译:

#ifdef Debug
...
#endif

但是 if 需要在 () 中使用表达式。使用,例如:

#define Debug 1

如果你想打印,0如果你不想。(但现在#if Debug用于条件编译)

于 2013-01-29T16:25:28.367 回答