nickadeemus2002
Programmer
good morning. I have the following question.
I am using a void function to dispaly a menu template that has a specific output format. The function is a void function with the following handle:
void productSelection()
My question is...is it possible to pass reference values into the the void function that will update variables withing the menu template?
For example, if I create this function:
void productSelection( double &drinksCost)
{
.
.
cout<<"The total cost for supplying drinks is"<<drinksCost;
.
.
}
will this work? My goal is to create a function that will display updated data to the screen in a specific format.
Please advise
I am using a void function to dispaly a menu template that has a specific output format. The function is a void function with the following handle:
void productSelection()
My question is...is it possible to pass reference values into the the void function that will update variables withing the menu template?
For example, if I create this function:
void productSelection( double &drinksCost)
{
.
.
cout<<"The total cost for supplying drinks is"<<drinksCost;
.
.
}
will this work? My goal is to create a function that will display updated data to the screen in a specific format.
Please advise