Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Add one string to another string?

Author
Message
CheatCat
17
Years of Service
User Offline
Joined: 7th Mar 2007
Location: Sweden
Posted: 6th Aug 2008 19:38
How should I do if I want add one string to another string?

Like this:


But this code dont work, I get the "cannot add two pointers" error!
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 6th Aug 2008 20:11
Use std::string or use strcat() or use sprintf() or use memcpy() etc, there are many methods.

Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 6th Aug 2008 22:47
and even then you have to have enough memory reserved for appending one string to another if you're using strcat() or memcpy().



Then keep in mind that need to run

delete [] messfrom;

before messfrom goes out of scope.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office

Login to post a reply

Server time is: 2024-11-20 17:23:31
Your offset time is: 2024-11-20 17:23:31