int main()
{
int value;
do {
do {
cout <<"Would you like to convert the weight or length:\n""Press 1 for Lengths\n""Press 2 for Weight or\n""Press 0 to terminate program\n";
cin >> value;
if (value != 0 && value != 1 && value != 2)
cout << "Invalid entry." << endl;
} while (value != 0 && value != 1 && value != 2);
switch (value)
{
case 0:
break;
case 1: convert_lengths();
break;
case 2: convert_weights();
break;
}
} while(value != 0);
return 0;
}
int main()
{
int value;
do {
switch (value) // Error: use of uninitialized variable
{
// code
}
} while (value != 0); // Error: use of uninitialized variable
return 0;
}