Jul 10, 2013 at 2:31pm UTC
what are you on about? that first untagged code doesn't even compile?
and use a more sensible thread topic.
Jul 10, 2013 at 2:33pm UTC
of course the non [code ] wont compile. it needs using namespace std
Jul 10, 2013 at 2:35pm UTC
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).
Jul 10, 2013 at 2:37pm UTC
its ok to pause at the end. it wont make a difference
Jul 10, 2013 at 2:40pm UTC
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 Jul 10, 2013 at 2:41pm UTC
Jul 10, 2013 at 2:46pm UTC
ok yes you shouldnt use system but i was talking about c++ code not exes to do it (i know; i should have specified)
Jul 10, 2013 at 5:31pm UTC
using namespace std;
then it works.
THANKYOU