Return 0; Vs. Return (0);

Hi everyone, I'm an absolute beginner when it comes to C++, or any other programming language for that matter. I only just started yesterday and I've been reading in a few books and on different sites for already written code etc.

The thing i see though is that return 0; and return (0); are both used.
So my question is this: Is there any difference between the two, is one the old way of doing things, or the other way around?


Also, in every example I've seen so far "#include <iostream> and "using namespace std;" has been included. Now I know that iostream gives me the possibility to use cout and cin etc. but I'm uncertain as to what namespace std; does and if it's needed to use if I'm not using more than one library.

Any help or comments given would be appreciated.
Thanks -- Ymabob
return 0; and return (0); are exactly the same, it's like writing 1+(1) instead of 1+1

std is the namespace in which all symbols of the standard library are located ( see http://www.cplusplus.com/forum/beginner/25538/ )
Last edited on
Ok thanks a lot.

It's good to know.
Topic archived. No new replies allowed.