I have to create some strings in the way cout works independent of data types.Is there any way to write the output to some char buffer or CString in a way similar to cout.

int n=25;
float f=5.11;
char r ='A';

cout<<"my age is = " <<n << "my height is = "<< f << "my grade is = " <<r;





So i have to create such a string and then use message box and show that. I dont know how to write such formatted strings to some buffer...

Any help is appreciated.

Thanks
Shashi