lesson 1 hello world - richardjoo/cpp_study GitHub Wiki

again, typical very first thing you would write... hello world ;-P

it is under

helloworld/hello.cpp

and the code looks like

#include <iostream>
using namespace std;

int main()
{
        cout << endl << "Hello, World!" << endl;
        return 0;
}

and you would compile like this

g++ hello.cpp

then you would get the executable file a.out if you don't want such funny name, and want to use file name as executable name or whatever you want to name the executable file name, then you would do this

g++ hello.cpp -o hello

okay, now you can execute your file like this

./a.out
or
./hello
⚠️ **GitHub.com Fallback** ⚠️