|
|
Hello World |
|
#include <iostream>
using namespace std;
int main (int argc, char** argv) {
cout << "Hello world" << endl;
return 0;
}
Valid C programs are also valid C++ programs! You may be accused of not using C++ properly but the program will work.
main is still the primary function that is looked for.
When main finishes the program finishes.
The include file doesn't use a .h extension.
This is a very new thing and many, many programs still use the old
extension. It's not currently an error to use it but you may get a
warning when using new C++ compilers.
The line
using namespace std;
Output is usually done completely differently than in C.