首页 > 其他 > 详细

error: ‘gets’ was not declared in this scope gets(str);

时间:2021-07-23 17:22:01      阅读:27      评论:0      收藏:0      [点我收藏+]

PAT中:
error: ‘gets’ was not declared in this scope
            gets(str);

技术分享图片
原因:
gets()方法已经不被PAT编译器支持了,因此要采用其他方法。
header添加:
         #include <iostream>
         using namespace std;
将gets(str);改为:
         cin.get(str,n);//n为str数组的长度

error: ‘gets’ was not declared in this scope gets(str);

原文:https://www.cnblogs.com/techgy/p/15049437.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!