I am currently away from my studies on holiday and am trying to keep up with the work where I can. I have a little experience in C# however C++ is new to me so I am having a little trouble using functions & param passing.
Visual Studio throws an error at me at "menu(selection);" detailing that 'menu': identifer not found, error:CS3861. Any advice/tips would be most appreciated. Here is my code so far:
using namespace std;
int main()
{
// print msg
cout << "This program will allow you to select an option 1-4.\nSelect an option to see the output.";
// declare selection - used to get desired user input
int selection;
//call menu
menu(selection);
}
void menu(int selection)
{
cout << "Please select an option:" << endl;
cout << "1. op1\n2. op2\n3. op3\n4. Exit program";
cin >> selection;
while (selection < 1 || selection>4)
{
cout << "Selection invalid, please choose an option from 1-4";
}
}