1、
当有下列语句时将出现此状况
- printf("\n\t\tSales as percentage of inventory:\t\t%f".\
- 100*((float)total_cars_sold[brand]/(float)
- cars_in_stock[brand]));
57:7: error: expected identifier before numeric constant
原因是\前的不是, 误写成了.
2、
原因:定义的enum结构体与其它处的宏定义有冲突。
比如
a.h中:
....
#define TRUE 1
.....
b.h中:
.....
typedef enum
{
FALSE=0,
TRUE=1
}bool;
.....
x.c中:
#include "a.h"
#include "b.h"
.....
编译x.c文件会出现上述错误