int simulationMenu();
int cointoss(int &win, int &loss);
void PickMarbles(char marbles[], int size);
void guessGame(int &games, int&tries);
void grandReport(char marbles, int size, int cWin, int cLoss, int rWin, int rLoss);
but when I put the cursor over cointoss, Pickmarbles or guessGame in the switch, the functions come up. I get errors if I put the whole function in the case
I don't think xismn can be any clearer. You aren't calling functions in your switch statement example above, but rather calling variables. To do functions you would do:
#include <iostream>
// prototype our function
int functName(int num);
int main()
{
std::cout << "Enter 1 to execute the function in a switch: ";
int selection;
std::cin >> selection;
switch(selection)
{
case 1:
std::cout << "Enter a number at random: ";
int randNum;
std::cin >> randNum;
// two for one, you call the function
// and print what it returns
std::cout << "You entered: " << functName(randNum);
break;
default:
std::cout << "\nThat wasn't 1!\n";
break;
}
return 0;
}
// function defined
int functName(int num)
{
return num;
}