i am trying to right a program where whenever the user inputs exit the program will close.
so the user can exit the program no mater where he is at in the program.
#include <iostream>
#include <string>
std::string run;
std::string exit;
std::string c;
int main()
{
std::cout << " would you like to run the prgram\n\n" <<
" yes for yes\n no for no or exit\n\n";
std::cin >> run >> exit;
if (run == "yes" || run == "Yes")
{
std::cout << "running....\n\n";
std::cin >> c >> exit;
i am trying to right a program where whenever the user inputs exit the program will close.
so the user can exit the program no mater where he is at in the program.
Is this academic? Or is there some actual reason that the user can't use "ctrl+c" like the rest of the world does?