Calling function

I just don't know how I would set the parameters in the main function to call this. Just the last one is all I need help with. Thanks
 
void print_calendar(int month, int year, ofstream& output)
Last edited on
You need to pass it a variable of type "std::ofstream", preferably one that you have initialized to a file. The definition of std::ofstream is exposed in the 'fstream' header so you have to remember to include that as well.
So, would I use anything with "output" at all? or would it just be "std::ofstream"?
output is just the name of the variable inside the function.
for calling the function, you can use any name you want, it just has to be of the specified data type.


what this function is doing there is receiving an address. (''&'' does that)
that makes it possible for the function to write at this address. that way you are changing the output, without having to return it.
Topic archived. No new replies allowed.