Aay*_*rma -1 c
char str[6]; do { printf("Enter the string you wanna check:"); scanf("%s", str); } while(str != "exit");
为什么这不起作用?
Lee*_*ker 5
str将永远相等"exit",因为你比较两个内存不同部分的地址.您可能希望比较字符串的内容,其中有一个函数strcmp().
str
"exit"
strcmp()
归档时间:
8 年,12 月 前
查看次数:
76 次
最近记录: