请在下面找到我在 C 中的函数。我在那里使用作为另一个文件的一部分的堆栈进行操作,但它工作正常。
void doOperation ( tStack* s, char c, char* postExpr, unsigned* postLen ) {
if ( ( c == ( '*' || '\' ) ) && ( s->arr[s->top] == ( '+' || '-' ) ) )
stackPush( s, c);
else if ( c == ( '+' || '-' ) && s->arr[s->top] == ( '*' || '/' ) ) {
stackTop( s, postExpr[postLen] );
*(postLen)++;
stackPop( s );
stackPush( s, c);
}
else if ( c == '(' )
stackPush( s, c);
else if ( c == ')' )
untilLeftPar( s, postExpr, postLen);
else {
stackTop( s, postExpr[postLen] );
*(postLen)++;
stackPop( s );
stackPush( s, c);
}
}
我收到这些错误,但我不知道出了什么问题:
c204.c:70:23: warning: character constant too long for its type [enabled by default]
c204.c:70:58: warning: multi-character character constant [-Wmultichar]
c204.c:70:65: warning: missing terminating ' character [enabled by default]
c204.c:70:2: error: missing terminating ' character
c204.c:71:3: error: void value not ignored as it ought to be
c204.c:71:19: error: expected ‘)’ before ‘;’ token
c204.c:88:1: error: expected ‘)’ before ‘}’ token
c204.c:88:1: error: expected ‘)’ before ‘}’ token
c204.c:88:1: error: expected expression before ‘}’ token
../c202/c202.c: In function ‘stackTop’:
../c202/c202.c:100:18: warning: the comparison will always
evaluate as ‘true’ for the address of ‘stackEmpty’ will never be NULL [-Waddress]
../c202/c202.c: In function ‘stackPop’:
../c202/c202.c:120:18: warning: the comparison will always
evaluate as ‘true’ for the address of ‘stackEmpty’ will never be NULL [-Waddress]
../c202/c202.c: In function ‘stackPush’:
../c202/c202.c:133:17: warning: the comparison will always
evaluate as ‘false’ for the address of ‘stackFull’ will never be NULL [-Waddress]
make: *** [c204-test] Error 1
这些错误的原因可能是什么?