The single most common C++ (C) program is
#include <iostream.h>
void main() {
cout << "Hello world" << endl;
}
Alternately,
#include <iostream.h>
#include <string.h>
void main() {
char *hello;
hello = new char[20];
strcpy(hello, "Hello world");
cout << hello << endl;
delete [] hello;
}
Simple examples, but they point out some of the language constructs:
Pointers are one of the hardest programming constructs to fully understand. A pointer variable contains a memory address which points to another memory address containing a value of the type of the variable. Pointers must be initialized to point to actual memory before they can be used. Assigning one pointer to another pointer makes both pointers refer to the same memory location. Dynamic memory assigned to a pointer via a new operation should be freed when it is no longer in use.