Homework Confusion (C++ functions)
Hey reddit! I'm getting started on my next homework, I am just a little confused...
"Write a function named time() that has an integer parameter named seconds and three integer reference parameters named 'hours', 'min' and 'sec'. The function is to convert the passed number of seconds into an equivalent number of hours, minutes and seconds. Using the references the function should directly alter the respective arguments in the calling function."
Ok. So this is how I was thinking of starting it:
int time (int hours, int min, int sec)
//can I just name them h, m, s? Will this affect it in any way?.. Hmm. So in my second function is where I convert the seconds, and just call on this function? Example: 8=hours, 53=min, 12=sec?
I'll work on it by thinkin this is what I need, hopefully someone can help :) take care :3
Posted Dec 2, 2011, 12:48 AM UTC