Two line do the same but are different (cout). Why?
Could you help me out understand the correct way to write c++?
I have 2 hello world examples:
Example 1:
Code:
#include <iostream>
int main (int argc, char * const argv[]) {
// insert code here...
cout << "Hello, World!\n";
return 0;
}
Example 2:
Code:
#include <iostream>
using namespace std;
int main ()
{
cout << "Hello World!";
return 0;
}
They both do the same obviously but should it be done one way or the other or it doesn't matter (please explain way).