How do I call a function outside of main or use a parameter to pass a reference?
If my function is:
void getData(int& diameter, int& price)
{
cout << "Enter in the diameter of the pizza in: " << endl;
cin >> diameter;
cout << "Enter in the the price of the pizza in: " << endl;
cin >> price;
}
how would I call it in main()?
Would it be getData(diameter, price) ?
or some variable = getData(diameter, price) ? I can't figure it out.
or getData(int&, int&) ?
Yes, it was declared at the first part of the program. I get an error saying it expected a primary expression before int?