I use sublime code editor, I’m getting Error: Range-based ‘for’ loops are not allowed in C++98 mode. How do I resolve it ?
Sir , I am not able to implement for each loop
@Anchal
Range based for loops were introduced in C++11. They are not available in previous c++ standards. Change your command to this.
Say your cpp file name is abc.cpp . Compile it like this in your command prompt / terminal :
g++ abc.cpp -std=c++11
OR
g++ abc.cpp -std=c++14
This indicates the compiler to use to later standards to compile. You may run the files like you normally do.