When I try to run my program this pops up: Run-Time Check Failure #3 - The variable 'quit' is being used without being initialized. I thought I initialized quit so I don't know how to fix this
//Name: Amanda Glavin
//Assignment: Converting Miles to Kilometeres
//Date: July 6, 2015
//Lab: Midterm
int makeMilesKmTable;
double miles, kilometers;
int quit;
while (quit != 1)
{
// Display the menu.
cout << "1. Run one conversion of miles to kilometers." << endl;
cout << "2. Run many conversions of miles to kilometers." << endl;
cout << "3. Quit." << endl;
cout << endl;
// Promt the user for a selection
cout << "Enter your selection. " << endl;
cin >> makeMilesKmTable;
while (makeMilesKmTable < 1 || makeMilesKmTable > 4)
{
cout << "That is an invalid selection. " << endl;
cout << "Enter 1, 2, or 3." << endl;
cin >> makeMilesKmTable;
}
switch (makeMilesKmTable)
{
case 1:
cout << "Enter the number of miles. " << endl;
cin >> miles;
kilometers = miles * 1.61;
ofs << miles << "=" << kilometers << endl;
break;
case 2:
{
int counter = 0;
while(counter < 301)
cout << "Enter the number of miles." << endl;
cin >> miles;
kilometers = miles * 1.61;
ofs << miles << "=" << kilometers << endl;
counter++;
break;
}