• Advertisement

Archived

This topic is now archived and is closed to further replies.

Too easy not to be working ???

This topic is 5969 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am using CString, in an attempt to concatenate some fields together. This is my code: char sCompanyCity[19]; char sCompanyProvStat[21]; char sCompanyPostZip[10]; CString sTemp4 (sCompanyCity, 19); CString sTemp5 (sCompanyProvStat, 21); CString sTemp6 (sCompanyPostZip, 10); CString sTemp7 = sTemp4 + ", " + sTemp5 + " " + sTemp6; // this line NOT working I''ve stepped it through debugger, and everything seems to be working fine, except for the last line. The fields sTemp4, 5 and 6 are all populated with city, provstat, and zip. But after the last line sTemp7 only contains the value from sTemp4 (City). Am I missing something painfully easy or what ?!? Thanks for any help, Chris In the mood for a little Fun & Games? Check out www.SunAndGames.com Home of Lost Enticer

Share this post


Link to post
Share on other sites
Advertisement
Nevermind. I got the answer.

Replaced the last line with:

CString sTemp7;
sTemp7.Format("%s,%s,%s",sTemp4,sTemp5,sTemp6);

In the mood for a little Fun & Games?
Check out www.SunAndGames.com
Home of Lost Enticer

Share this post


Link to post
Share on other sites
you could have also used:


CString sTemp7 = CString (sTemp4) + ", " + sTemp5 + " " + sTemp6;

Share this post


Link to post
Share on other sites

  • Advertisement