How to change mode from c++98 mode in Dev-C++ to a mode that supports C++0x (range based for)?
Go to Tools -> Compiler Options -> "Compiler" tab
Check the checkbox labeled, "Add the following commands when calling the compiler"
And add in the text entry box, "-std=c++11" or if that doesn't work "-std=C++0x"
Should be something like that anyway, I haven't had Dev C++ installed for many years, so I had to look at some screenshots on Google to remember.
Orwell Dev C++ doesn't work with C++11
It is a known bug that to_string
does not work with MinGW yet (which is actually GCC's fault, to a degree):
- http://sourceforge.net/p/mingw/bugs/1578/
- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52015
Intellisense is often driven by a different engine than the compiler (as very few compilers have hooks to make intellisense easy), so that's likely why you're seeing it in your IDE when it's not supported by your compiler.
how to enable C++11 or C++14 in Dev C++ IDE
Follow these Steps in DevC++.
Got to Tools -> Compiler Options... -> Settings -> Code Generation
In language standard(std), choose -> ISO C++11
more https://www.geeksforgeeks.org/how-to-fix-auto-keyword-error-in-dev-cpp/
I am using the dev c++ and i am getting the error ( C++98 'array' must be initialized by constructor)
You are trying to use the so called initializer_list
(take a look here if you do not know what they are) which is a way of costructing objects introduced by c++11
.
Hence you need to tell your compiler that you want to use c++11
by passing the argument -std=c++11
to the compiler itself.
Take a look at this question to see how to do it.
Related Topics
Variable or Field Declared Void
Erasing Vector::End from Vector
Specialization of 'Template<Class _Tp> Struct Std::Less' in Different Namespace
Free Function Versus Member Function
Why Implicit Conversion Is Harmful in C++
C++ Static_Cast Runtime Overhead
How to Use C++14 Features When Building Qmake Projects
How Could Comma Separated Initialization Such as in Eigen Be Possibly Implemented in C++
How to Tell Pyximport to Use the Cython --Cplus Option
Is It Safe to Reinterpret_Cast an Enum Class Variable to a Reference of the Underlying Type
How to Implement a Map with Different Data Types as Values
Borderless Window with Drop Shadow
Enumdisplaydevices VS Wmi Win32_Desktopmonitor, How to Detect Active Monitors