Link to home
Start Free TrialLog in
Avatar of justinng
justinng

asked on

Question on String manipulation

Hi,
     I'll illustrate my problem with a program segment.
---------------
int total=100;
CString str = "There are altogether ", str2;

//my intention is to combine the string which will appear
//like this: "There are altogether 100 cats!"
str2 = str + total + " cats!"; // this is improper!
MessageBox(str2);
--------------------------------
My question is how can I combine the whole thing above to have a message which says "There are altogether 100 cats!"?

For your informations, I'm writing my programs using MSVC 5.0, a dialog-based program and working on win98 platform.

Any help offered is very much appreciated!
ASKER CERTIFIED SOLUTION
Avatar of chensu
chensu
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial