Sams teach yourself

Hey guys,
Currently I'm going to school for a minor in comp sci. I've got a C++ class coming up and my family got me Sams Teach yourself C++. I'm stuck on the very first lesson. Its a simple Hello world app.

#include <isostream>

int main()
std::cout << "Hello World!" << std:endl;
return 0;

This one wont work it hangs on the std::cout, then i pull this one from a website to test it and this one works.
#include <iostream>
using namespace std;
void main()
std::cout << "Hello World!" << endl; std::cout << "Welcome to C++ Programming" << endl; }

Can someone please explain to me why? The book has me using MSV C++ 2010 Express. Thanks
You wrote isostream, not iostream.

The example you got from the website doesn't actually conform to the C++ standard, as main needs to return int. And "using namespace std;" is also generally looked down upon.

I'd stick to your book.
Thank you Blacksheep
void main()

Is not considered proper programming.

some programs will let it compile but main is expected to
return 0;
when the program completes.
It could return something else if a exception is encountered.

int main() is what you want to use.
closed account (3qX21hU5)
also another thing I see in the first code is that you are missing a extra : in std::endl;.

The first way you wrote it was actually the better way to use namespaces then the using namespace std;, but that is for later, when beginning learning C++ you can use using namespace std; with no problem just try not get into the habbit of doing it because it loads a hold bunch of crap you don't need.
Thanks for all the help guys. Will for sure be on the forums more, its already been very helpful.
Topic archived. No new replies allowed.