预处理器宏变量

时间:2013-02-27 16:39:48

标签: c hash struct c-preprocessor assign

我有代码:

#DEFINE NEW = 1;

结构:

typedef struct PCB
{

 /*Process state:new, ready, running, waiting, terminated*/
 int state;
 }PCB;

如何分配NEW,使state = 1?

更多信息,我收到错误:

expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘=’ token

1 个答案:

答案 0 :(得分:1)

删除分号和=

#DEFINE NEW 1