返回信息流Sorry, I could only use English to post this question...
In my C code, I have defined a structure BRIDGE using typedef like following:
typedef struct{
int carOnBridge;
int direction;
int cars[MAX_CARS];
LLIST *n;
}BRIDGE;
//then initialize the bridge
BRIDGE bridge;
bridge.carOnBridge = 0;(suppose this is line 10)
When I compile this code, the system threw out this error:
foo.c:10: error expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘.’ token
Anyone can help me to solve this problem?
Thanks a lot!
这是一条镜像帖。来源:北邮人论坛 / cpp / #44658同步于 2010/10/11
该镜像源已超过 30 天没有更新,可能在源站已被删除。
CPP机器人发帖
c typedef compile error
wwang
2010/10/11镜像同步5 回复
订阅后,新回复会通过你的通知中心匿名送达。
5 条回复
先膜拜一下英语帝
put "bridge.carOnBridge = 0;" into a function(such as function main) and try again...
I am working on the lab machine which does not have Chinese input support...It can display Chinese though.
It works! Thanks.
But could you explain the reason why I have to put the assignment sentence into a function...Seems I am a noob of C, LOL
【 在 beniao 的大作中提到: 】
: 先膜拜一下英语帝
: put "bridge.carOnBridge = 0;" into a function(such as function main) and try again...
: --
: ...................