Hello everyone,
I am brand new in the world of programming and I am currently trying to do the "hello world"/ "Game Over" project.
I'm sure it is hilarious that I am having issues already I just don't know if the book I'm using is outdated or not as the code written in the book doesn't work but another code I found online does. I was just wondering what the difference (in noob terms) is between them...
1 2 3 4 5 6 7 8 9 10 11
// Game Over
// A First C++ program
#include <iostream>
int main()
{
std::cout<<"Game Over!"<<std::endl;
return 0;
}
That was the books code.
This is the simpler code I found...
1 2 3 4 5 6 7 8 9 10 11 12
#inc <iostream>
usingnamespace std;
int main()
{
cout<<"Game Over!"<<endl;
return 0;
}
this worked fine. Could you explain the differences please?
Which compiler do you use? Symbol "std::cout" not being found from standard library header "iostream" is an indication of very old version of standard library (and compiler).
I'm using microsoft visual 2012 express the second code still didn't work. there was issue's. I could show screenshots of what it says etc. Is there a way we could chat through skype or msn messenger or similar program?
#include <iostream> //inc changed to include
usingnamespace std;
int main()
{
cout<<"Game Over!"; // taken out the <<endl; because it wass not needed
system("pause") //keep the system open
return 0;
}