I'm very new to C++
in C you put system("pause") at the end before return 0.
How do you do that in C++?
I have my answer Thanks
Printable View
I'm very new to C++
in C you put system("pause") at the end before return 0.
How do you do that in C++?
I have my answer Thanks
same thing
Code:#include <cstdlib>
int main()
{
system("pause");
return 0;
}
Vorkosigan,
FYI - 99% of what you do in C, will work in C++. But, sometimes (probably most-times) there is a "better" C+ way.
And in this case, in C and C++ there is a better way. Search the board for system("pause")Quote:
Originally posted by DougDbug
Vorkosigan,
FYI - 99% of what you do in C, will work in C++. But, sometimes (probably most-times) there is a "better" C+ way.
or read the faq
So is that why its bad to use system calls. Its platform specific?
Platform specific, plus "pause" might point to something else, that could be malicious.
plus you made an expensive call to the operating system. Slower, more resources used, chance to fail. Any more questions?