我想比较用户输入,$$
看看它是否匹配用户输入的参数之一。我还想比较一下是否`tty' &
匹配用户输入的参数之一。就像是:
int main(int argc, char **argv)
{
if (argv[4] == '`tty` &') { //line 31
fprintf(stderr, "error %s\n", argv[4]);
return(1);
}
if (argv[2] == '&&') { //line 36
fprintf(stderr, "error%s\n", argv[2]);
return(1);
}
}
我收到错误消息
ai.c:31:21: warning: character constant too long for its type
ai.c: In function ‘main’:
ai.c:31: warning: comparison between pointer and integer
ai.c:36:21: warning: multi-character character constant
ai.c:36: warning: comparison between pointer and integer
请帮忙。