So I'm following the tutorials on this page: http://www.cplusplus.com/doc/tutorial/control/ But I'm having trouble doing a range/based for loop. I found this page: GNU GCC compiler updatingThe answer there says I should open "Project" and "Properties". But when I try that, the "Properties" option is grayed out with no explanation: http://imageshack.com/a/img571/4371/xd1x.png So.. how can I activate range/based for loops?
To do this, click on Tools in Dev-C++ IDE. Under this click the “Settings” tab. Inside the settings tab, we can see the “Code generation” tab. Click on the “Language Standard (-std)” value and set it to “ISOC++11” or “GNUC++11” as per your requirement.
Pass -std=c++11
flag to the compiler. Certainly GCC should be fresh enough (>=4.7) to support all these modern standards. For CodeBlocks 13.12: Settings -> Compiler -> Tab "Compiler Flags" -> Option "Have g++ follow the C++11 ISO C++ [-std=c++11]"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With