covert to String from printf result
I'm average to C++. I have a question to ask for String.
Eg. 1
CString write;
int time = 20;
int counter = 3;
write += "Time ";
write += itoa(time,buffer,10);
write += ":\tProcess ";
write += itoa(counter,buffer,10);
write += " arrive\n";
printf(write);
// This will print "Time 20: Process 3 arrive"
but I want to save the whole sentence just like...
Eg. 2
write = printf("Time %d:\tProcess %d arrive\n",time, counter);
but it printed out rubbish...
How can I solve this, yet don't go so much trouble in Eg. 1?
Please help...

