Why does Code blocks show me the error
error: in C++98 'pro' must be initialized by constructor, not by '{...}'|
When I use std::string pro{'A','B','C','D','E','F'};
?
How can I fix this?
Why does Code blocks show me the error
error: in C++98 'pro' must be initialized by constructor, not by '{...}'|
When I use std::string pro{'A','B','C','D','E','F'};
?
How can I fix this?
You are using C++ 98 standards and it doesn't support { }
initialization.
You have two options...
-std=c++0x
flag while compiling to use newer C++ standards.