Starting C++ - 01
To follow this perfectly you need:-
- A C++ Compiler
- Knowledge in programming is useful
Right, lets look at some code:
#include <iostream>
using namespace std;
// this is a comment, this is not read by the compiler.
// namespaces will be explained later.
int main() {
cout << "Hello World!" << endl;
return 0;
}
Okay, now, lets look at it line by line:-
#include <iostream>
Without this line, none of the code would work, this includes the C++ code that makes the C++ program work.
using namespace std;
As the comments below state, namespaces will be done in later articles
int main() {
This line, starts our program.