文章

1

粉丝

234

获赞

1

访问

8.4k

头像
1006 帮忙看看为什么Compilation Error
学习交流
发布于2021年2月27日 22:22
阅读数 8.4k

#include<bits/stdc++.h>
using namespace std;

char s[105];
int main(){
    while(gets(s)){
        strrev(s);
        puts(s);
    }

    return 0;
}
 

运行状态: Compilation Error

Main.cpp: In function ‘int main()’:
Main.cpp:6:11: warning: ‘char* gets(char*)’ is deprecated [-Wdeprecated-declarations]
     while(gets(s)){
           ^
In file included from /usr/include/c++/5/cstdio:42:0,
                 from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:46,
                 from Main.cpp:1:
/usr/include/stdio.h:638:14: note: declared here
 extern char *gets (char *__s) __wur __attribute_deprecated__;
              ^
Main.cpp:6:11: warning: ‘char* gets(char*)’ is depre
登录查看完整内容


登录后发布评论

1 条评论
admin SVIP
2021年2月27日 23:14

strrev可能被限制使用了

赞(1)