Ignore the fact that my functions are rather incomplete. I really have a question about whether or not i can declare variables in the function when i declare it.
if (choice == ‘T’)
area_triangle();
else if(choice==’S’)
area_square();
else if(choice==’R’)
area_rectangle();
else if (choice == ‘Q’)
cout << “You have decided to quit. Have a nice day!” << endl;
else
{
cout << “You have not elected a valid choice” << endl;
}
while (choice != ‘Q’)
}
You can declare a variable wherever you want. Passing 'choice' to menu() is unnecessary. Declare 'choice' before it used as a charnotchar *
For a function each and every parameter variable needs a type (not only the first). This void area_square (float side, square_area) is wrong, must be void area_square (float side, float /*?*/ square_area)
This void area_square(); and this void area_square (float side, /*missing type here*/ square_area) are different function due to the parameter. The linker will complain that area_square() cannot be found.
The compile accepts only '' and "" as quotation marks. No fancy quotation marks are allowed.