what are you on about? that first untagged code doesn't even compile?
and use a more sensible thread topic.
of course the non [code ] wont compile. it needs using namespace std
Don't pause programs at the end, run them from the command line.
The top code doesn't compile because cout and endl are in the std namespace ( note "std::" in the second code).
its ok to pause at the end. it wont make a difference
It does when you use system calls. But generally you should run them from the command line like Lowest said or at least get a IDE that has a option to keep the console open after the program finishes.
Last edited on
ok yes you shouldnt use system but i was talking about c++ code not exes to do it (i know; i should have specified)
using namespace std;
then it works.