Does that actually compile? I think I can see at least three errors there?
#include <iostream.h> should be #include <iostream> (uses the newer library)
missing using namespace std or should have std:: at the beginning of cin and cout
main should have a return type of int.
No, that should work - the C++ headers with .h on the end are basically the non-namespaced versions (I think they're mainly a hangover from when C++ was still evolving, but IIRC, they are part of the standard).
As for the no return type on main(), I know Visual C lets you do that, but I'm not sure whether it is 'correct' or not
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.