How to set up c++17 as default

Someone please help me to set up c++17 as default. Currently to use c++17 I need to compile it using “g++ --std=c++17 sol.cpp” instead what I want is to just use “g++ sol.cpp” where by default g++ uses c++17.

Thank You

You can set up an alias on a Linux Machine. Just do it like this:

echo "alias g++='g++ -std=c++17'" >> ~/.bashrc; exit

Then, whenever you use g++, it will do g++ -std=c++17.

1 Like

@ankushkhanna Thank You