Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ ../cpla.sh p135-2
- $ clang++ p135-2.cpp -std=c++03 -Wall
- p135-2.cpp:14:13: warning: range-based for loop is a C++11 extension [-Wc++11-extensions]
- for (int& x : array){
- ^
- 1 warning generated.
- x=2
- x=4
- x=6
- x=8
- x=10
- C++N4741(68)9.5.4 The range-based for statement [stmt.ranged]p135-2.cpp
- $ clang++ p135-2.cpp -std=c++2a -Wall
- x=2
- x=4
- x=6
- x=8
- x=10
- C++N4741(68)9.5.4 The range-based for statement [stmt.ranged]p135-2.cpp
- $ g++-8 p135-2.cpp -std=c++03 -Wall
- p135-2.cpp: In function 'int main()':
- p135-2.cpp:14:15: warning: range-based 'for' loops only available with -std=c++11 or -std=gnu++11
- for (int& x : array){
- ^~~~~
- p135-2.cpp:15:3: warning: 'x' is used uninitialized in this function [-Wuninitialized]
- x *= 2;
- ~~^~~~
- ../cpla.sh: line 17: 4884 Bus error: 10 ./$1g03 $2
- $ g++-8 p135-2.cpp -std=c++2a -Wall
- x=2
- x=4
- x=6
- x=8
- x=10
- C++N4741(68)9.5.4 The range-based for statement [stmt.ranged]p135-2.cpp
Add Comment
Please, Sign In to add comment