printing out string from integer

I have a struct Time:

struct Time {
int hours;
int minutes;
Time(int hrs = 0, int mins = 0){
hours=hrs;
minutes=mins;
}
};

What i'm trying to do is display some info as a string using:
string xxxxxx::toString()
{
return date_.datetoString()+ "\nInfo: " +info_+ "\nPerson: " +person_.firstName+ " " +person_.lastName+ "\nTime: " ;//+time_.hours+":"+ time_.minutes+ "\n";
}

the Date was an integer as well but i made a datetoString() function in a Date class i have made.

What i'm having trouble with is how to display the time using the time struct. I don't think i'm supposed to make another timetostring function and have no idea what to do.

In my class time is set like so: Time time_; under protected


any help would be appreciated
Use strftime() from <ctime>.
I don't want to add any more libraries
<ctime> isn't a library. It's the C++ header that encapsulates the C library's <time.h>. Every C++ program uses the C library.
Topic archived. No new replies allowed.