How to compile and run a C++ program?
#include <iostream>
int main() {
std::cout << "Hello, C++!\n";
}
Terminal
$ g++ -std=c++23 -Wall -Wextra hello.cpp -o hello
$ ./hello
Hello, C++!
The steps inside are: preprocessing, compiling, assembling and linking. See C++ Installation and Setup.
Learn more about the similar topics:
| Tutorials |
|---|
| C++ Introduction |
| C++ History and Versions |
| C++ Features |
| C++ vs C |
| C++ Installation and Setup |
| Your First C++ Program: Hello World |
| C++ Syntax |
| Exercises & Assignments |
|---|
| No Content Found. |