C++出现‘atoi'was not declared in this scope 应该如何解决?

在学习C++,结果在命令行使用g++ n.cpp 编译的时候出现了这个错误,换成stoi(information)也还是同样的错误,

谷歌了半天,终于找到问题原因和解决方法:

问题原因:MinGW不是最新的,并不能识别C++的版本,原文是这样说的:

MinGW isn't maintained by the same group as GCC itself, so it's not always up to date

解决方法:使用 g++ -std=c++11 n.cpp进行编译。

猜你喜欢

转载自blog.csdn.net/dulingmo/article/details/80024517
今日推荐