g++

Use the g++ command to compile C++ code. Provide the filename containing the C++ code as the source file. Optionally, use the -o flag followed by the desired output file name. For example:

g++ source_file.cpp -o output_file