c++ hello world
C++ programming language was developed by Bijarne Stroustrup in 1979 at Bell Labs, based on C, it adds object oriented features and other enhancements. Originally named C with Classes, renamed C++ in 1983. It is regarded as an intermediate-level language as it comprises a combination of both high-level and low-level language features. It is used to develop a wide variety of software, such as video games, operating system software, application software, device drivers, embedded software, server and client applications. Its source code files are often with the extension “.cpp”
hello.cpp
//Including the libraries #include <cstdlib> #include <iostream> using namespace std; //The main method that executes first when the program runs. int main(int argc, char** argv) { //Printing out a string. cout << "Hello world! This is my first program in c++."; return 0;//The end of this programs. }
Compile the hello world c++ program. This command will create an executable file hello
gcc -o hello hello.cpp
Run the hello world c++ program.
./hello
Search within Codexpedia
Search the entire web