// Popilization.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <time.h>
usingnamespace std;
int main(){
bool running = false;
int time = 0;
int ans = 0;
running = true;
while (running == true){
system("cls");
cout<<"1. Play"<<endl;
cout<<"2. Save | Load"<<endl;
cout<<"3. Quit"<<endl;
if (ans == 1){
system("cls");
cout<<"Play"<<endl;
cin.get();
}
if (ans == 2){
system("cls");
cout<<"Save/Load"<<endl;
cin.get();
running = false;
}
if (ans == 3){
system("cls");
cout<<"Thanks For Playing!"<<endl;
cin.get();
return 0;
}
cin.get();
}
cin.get();
return 0;
}
Currently all it does it display the menu and when I try to select an option and have it display the message, it jumps right back to the beginning of the loop. I tried cin.get(); as you can see. It also refuses to let the program close when I choose option 3. Its infuriating me, please someone tell me how to properly pause and quit a loop.