Dev-C++ 5.11不支持C++ 11编译

版权声明:如若转载,请联系作者。 https://blog.csdn.net/liu16659/article/details/86775378

Dev-C++ 5.11不支持C++ 11编译

1.问题

Dev-C++ 不支持 C++ 11新特性。例如在使用编译如下这段代码时,就会报错。

#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<iostream>

using namespace std;

int main(){
	int i = 2;
	string res = to_string(i);
	cout << "res = "<< res;
}

报错如下:
在这里插入图片描述

2. 修正办法

step 1:
在这里插入图片描述
step 2:
在这里插入图片描述
得到的执行结果如下:
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/liu16659/article/details/86775378