Question about functions

I am curious, how can I pass data from one void function to another?
An example of such an event would be like in a program where I have several functions like:
getInfo() //to gather information on customer
setTruckLoad() //set the truck load based on information from get info
displayAllInfo() //gets info from both getInfo() and setTruckLoad()

How can i pass data between these? Thanks in advance!
You can use pointer arguments or make them members of a class so you can make the information passed between those functions private and unmodifiable outside that class
if you want that only these functions should use the specified datalike cut_id,cust_bill etc. then use the concept of classes.otherwise if your data is global and accessible to all the functions then you can use functions with arguments e.g. through getinfo you read the details of cust_id and cust_bill then call the displayallinfo(cust_id,cust_bill).For this you must have declared displayallinfo(int,int);
Hope this will help you
@Bazzy

Ah, thank you!

@matanuragi

Oh, I see. It is very elementary, I should have paid more attention in class. Thank you, my programs will look very clean now!
Topic archived. No new replies allowed.