so recently i used a for loop,that a person from this forum showed me
for(char c:str)
this gave me the compile error ranged loops not allowed in c++ 98 or smth
now my question is,why is an older version of c++ the default?
is it not safe to use the 11 version?
should i switch back or should i continue coding in c++11 standard?
If you are learning C++, or writing fresh code, use the current standard, not the superseded one. -std=c++11 -Wall -Wextra -pedantic-errors
If you have legacy code that breaks with C++11, you may want to use the older standard till it is cleaned up.
(In some scenarios, you may want to use an older version of the compiler.)
The GNU people think that you should have to specifically initiate C++11 support because, they argue, the compiler doesn't completely support the C++11 standard.
Which is nonsense, because (1) people want whatever C++11 features they can get, (2) GCC supports a very large subset of the same desired features available in other C++11 compilers, (3) they had no such compunction when C+98 was standardized.