How would one go about returning a value in a type void function? I would assume that it is possible in some way because my professor has assigned my class an assignment in which we have to do just that. We have to make 5 functions, all type void to integrate with our previous project. Here is the prompt for the first function:
getBalance is a function that will open a file called balance.txt, and retrieve the credit value. If there is nothing in the balance.txt file, or it doesn’t exist, assume that the user wants to begin a new account, with 50 credits. getBalance is a void function that returns either the balance from the file or 50 credits.
I understand the fileio part, but I don't know how to return balance in a void function. Would anybody be willing to point me in the right direction? I'm not asking for any code, just advice. Thanks.