博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Code::Blocks设置支持C++ 11
阅读量:7168 次
发布时间:2019-06-29

本文共 489 字,大约阅读时间需要 1 分钟。

进入codeblocks,点击Settings --> Compiler..,进入如下页面

勾选“Have g++ follow the C++11 ISO language standard [-std=c++11]”并确定。
可以通过如下示例来查看效果:

#include 
#include
using namespace std;int add(int a, int b){ return a + b;}int main(){ function
f = add; cout << f(10, 20) << endl; auto g = []{ return "Hello World"; }; cout << g() << endl; int a[5] = { 1, 2, 3, 4, 5 }; for (const int & num : a) { cout << num << endl; } return 0;}

 

转载地址:http://gbqwm.baihongyu.com/

你可能感兴趣的文章