I keep getting an error when I use void display in the header. I need to use it for my assignment. I don't know why it's doing this? (this is also a portion of the code)
#include <iostream>
#include <limits>
void(display);
usingnamespace std;
int main(void)
{
char selection = ' ';
do
{
cout << "\tHelp(H)\t Arithemetic(A)\t Relational(R)\t Logical(L)\tQuit(Q)\n";
cout << " Select a letter for the operation that you would like to perform\n";
cin >> selection;
switch (selection)
{
case ('h'):
case ('H'): //select H or h to select the help menu
{
cout << "Each letter that you input will take you to a different operation.\n"
<< "If you select A, you will be taken to a program that will subtract or divide 2 integers.\n"
<< "If you select R, you will be taken to a program that will rationalize 2 integers.\n"
<< "If you select L, you will be taken to a program that will send you to a logical operation.\n"
<< "If you select Q, you will quit the program.\n";
system("pause");
//added in this line to make it where pressing any key returned the user to the regular menu
break;
}
//ends the H/h selection menu
case ('a'):
case ('A'):
{
int a, b;
char c = ' '; //declaring variables
cout << "Input a value for a = "; //inputting numbers
cin >> a;
while (cin.fail())
{ cout << "Invalid Input - please try again. \n";
cin.clear(); //this code stops the program from infinite loops
cin.ignore(256, '\n');
cin >> a;
}
cout << "Input a value for b = "; //inputting numbers
cin >> b;
while (cin.fail())
{
cout << "Invalid input - please try again. \n";
cin.clear();
cin.ignore(256, '\n');
cin >> b;
}
while (c != '1' || c != '2')
//makes a loop for when c doesn't equal 1 or 2
{
cout << "Input a value of 1 for subtraction or 2 for division ";
cin >> c;
if (c == '1') //== when c is equal to 1
{
cout << "(a - b) is equal to " << a << " - " << b << " = " << (a - b) << "\n";
system("pause"); //returns users to the main menu
break; //system stop here if it c was inputted as 1
}
elseif (c == '2')
{
cout << "(a / b) is equal to " << a << " / " << b << " = " << (a / b) << "\n";
system("pause");
break;
}
else
cout << "Error, enter a proper integer value\n"; //when they input a number that isnt 1 or 2 it tells them to fix it
}
system("pause");
break;
} return 0;}