While learning C++, I tried to compile a HelloWorld program using the 'gcc' command' and found that I needed to add the '-lstdc++' option for it to compile successfully:
gcc HelloWorld.cpp -lstdc++
However, I idly tried to use 'c++' as a command to compile a file, and much to my surprise, it worked without me needing to use the -lstdc++ option, and it produced an output executable file that ran just as well as the one produced by the 'gcc' command with the '-lstdc++' option:
c++ HelloWorld.cpp
Does anyone know if there are any hidden differences in output between the two commands, and if the 'c++' command may be safely used in place of the 'gcc' command? I have searched a dozen or so websites, and not a single one of them had any documentation or samples for code featuring 'c++' used as a command to compile a C++ executable file in the OS that I'm running (Linux Ubuntu 20.04).