I'm working on a code, and I tried it in one compiler and everything goes well, but in another it says "function strupr not declared on this scope". I can't understand why this happen. This is my code:
我正在研究一个代码,我在一个编译器中尝试过,一切顺利,但在另一个代码中,它表示“函数strupr未在此范围内声明”。我不明白为什么会这样。这是我的代码:
#include <stdio.h>
#include <string.h>
int main(){
char c,S[100];
int x=0,i,a,b;
for(i=0;c!='\n';){
scanf("%c",&c);
if (c!=',' && c!=' ' && c!='.' && c!='!' && c!='?'){S[i]=c; i++;}
}
while(S[0]!='D' && S[1]!='O' && S[2]!='N' && S[3]!='E'){
strupr(S);
for(i=0;S[i]!='\n';i++){}
for(a=0,b=(i-1); a<=b; a++,b--){
if (S[a]!=S[b]){x+=1;}
}
if (x==0){printf("You won't be eaten!\n");}
else {printf("Uh oh..\n");}
c=a;
x=0;
for(i=0;c!='\n';){
scanf("%c",&c);
if (c!=',' && c!=' ' && c!='.' && c!='!' && c!='?'){S[i]=c; i++;}
}
}
return 0;
}
Why do I get this error?
为什么我会收到此错误?
1 个解决方案
#1
2
strupr()
looks like a Windows-only call.
strupr()看起来像一个仅限Windows的调用。
#1
2
strupr()
looks like a Windows-only call.
strupr()看起来像一个仅限Windows的调用。