gpt4 book ai didi

c - "function strupr not declared on this scope"

转载 作者:太空宇宙 更新时间:2023-11-03 23:24:57 26 4
gpt4 key购买 nike

我正在编写代码,我在一个编译器中尝试过,一切顺利,但在另一个编译器中它说“函数 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;
}

为什么会出现此错误?

最佳答案

strupr() 看起来像是一个仅限 Windows 的调用。

关于c - "function strupr not declared on this scope",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29571898/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com