void tserver(int id) { if(debug){ useResource(10000,id);} char msgBuf[MAX_MSG_LEN]; if (msgQReceive(myMsgQId, msgBuf, MAX_MSG_LEN, WAIT_FOREVER) == ERROR) return ; printf("Message from client: %s ", msgBuf); }
竟让会报错
ccsimpc -g -mpentium -ansi -fno-builtin -fno-defer-pop -I. -IC:Tornado2.2 argeth -DCPU
=SIMNT -DTOOL_FAMILY=gnu -DTOOL=gnu -c ..homework2.c
..homework2.c: In function `tserver':
..homework2.c:54: parse error before `char'
..homework2.c:55: `msgBuf' undeclared (first use in this function)
..homework2.c:55: (Each undeclared identifier is reported only once
..homework2.c:55: for each function it appears in.)
make: *** [homework2.o] Error 0x1
void tserver(int id) { char msgBuf[MAX_MSG_LEN]; if(debug){ useResource(10000,id);} if (msgQReceive(myMsgQId, msgBuf, MAX_MSG_LEN, WAIT_FOREVER) == ERROR) return ; printf("Message from client: %s ", msgBuf); }
ccsimpc -g -mpentium -ansi -fno-builtin -fno-defer-pop -I. -IC:Tornado2.2 argeth -DCPU
=SIMNT -DTOOL_FAMILY=gnu -DTOOL=gnu -c ..homework2.cDone.
哎,为什么呢?