| reddeffect (2) | |
|
void GetSalesInfo(int accnum,//stores account number INPUT int day,//stores day number INPUT int month,//stores month number INPUT int year,//stores year number INPUT char countycode,//stores countycode INPUT double totalsale,//stores sale cost before tax PROCESSING int shippingweight); Main(){ //all vars declared and initialized here //this function gets input from the user and uses it later in other functions //the problem I have here is that the input from the user that is stated //in this function goes back to intitialized value when the function is over //how do i fix this GetSalesInfo(accnum,day,month,year,countycode,totalsale,shippingweight); } void GetSalesInfo(int accnum,//stores account number INPUT int month,//stores day number INPUT int day,//stores month number INPUT int year,//stores year number INPUT char countycode,//stores countycode INPUT double totalsale,//stores sale cost before tax PROCESSING int shippingweight) { cout << "Please Enter your Account Number: "; cin >> accnum; cout << "Please Enter the Sales Date.\n"; cout << "Enter Month: "; cin >> month; cout << "Enter Day: "; cin >> day; cout << "Enter Year: "; cin >> year; cout << "Please Enter the County Code: "; cin >> countycode; cout << "Please Enter the Sales Amount: "; cin >> totalsale; cout << "Please Enter the Weight:"; cin >> shippingweight; cout << "\n\n\n"; } | |
|
|
|
| Chervil (806) | ||
Pass the parameters by reference, using the & operator.
| ||
|
|
||