So I've made a calculator but after it solves the problem it shows it for about half a second and then closes. Is there a C++ command that can allow me to run the batch command "pause" or is there any C++ command that let's me pause it?
Thank you for your time
~LuaHax
You could call the pause command like so:
Code:
system("pause");
But I would not recommend using system since it is "evil".
Rather, just get some user input:
C:
Code:
#include <stdio.h>
int main()
{
getchar();
return 0;
}
C++:
Code:
#include <iostream>
int main()
{
std::cin.get();
return 0;
}
system("pause");
It will work just fine but for the finished program or a serious one you are relasing I would recommend
cin.get();
cin.get();
It works well for me.