Here is the code I have for get_avg(), obviously it does not return both avg_temp_hi and avg_temp_lo. How can I do this? Is there an easier way than making a structure? If not, how and where would I set up the structure? Thanks for the help.
Jikax is right. No, I am not learning on my own. And yes, this function is a class member. I declared num_days in another part of the program GRex. The entire program compiles and runs except for this part which I can't figure out how to do. So declarations are not my problem here. I did not present the entire program but I can if you guys think it would help.
I'm totally sorry. It looked like a self-taught thing and I haven't used classes yet so I didn't know :: was for the class. Your code didn't show arrays, so I thought that it was just regular ints. I get the classes a little bit better now though. Thanks
You could also make it a bit less cumbersome by putting: typedef std::pair<float,float> average; somewhere in your class definition (in a public: area) so all of those std::pair<float,float> in the above code would, instead, read DailyTemp::average
Note that I have changed all your floats to doubles - it is more precise than float.
Also note that the method now returns avgTemps instead of float (or double).