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 / Combine Two char*

Author
Message
kklouzal
15
Years of Service
User Offline
Joined: 15th May 2009
Location: Arizona
Posted: 2nd Jun 2009 01:54
Hello, is it possible to combine two char* variables into one char* variable?

AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 2nd Jun 2009 02:04
Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 2nd Jun 2009 02:46
I believe that you want strcat(). It concatenates char arrays.



#ifdef _DEBUG
FixBugs(All);
#endif
Timidon
19
Years of Service
User Offline
Joined: 26th Jun 2005
Location: Bakersfield, Ca. USA.
Posted: 2nd Jun 2009 05:53
strcpy (target, source) - this will copy the contents of "source" to "target"

strcat (target, source) - this will appendage "target" with source" as in Bran Flakes example.

Good luck to yah.

There are many answers but just one question" ~ Jerilith the Mad
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 2nd Jun 2009 11:15
If I search your exact question on google, the second link provides you with perfectly good answers. Please use google before posting questions, it will answer your questions much faster than we will.

kklouzal
15
Years of Service
User Offline
Joined: 15th May 2009
Location: Arizona
Posted: 2nd Jun 2009 22:18 Edited at: 2nd Jun 2009 22:45
I had googled it, and I was using strcat but it wasn't working properly so I figured strcat was not what I should be using, I posted here and the kind forum people reassured me that strcat was what was to be used.

=D I always google before i post <3

AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
Posted: 2nd Jun 2009 23:00
Quote: "I had googled it, and I was using strcat but it wasn't working properly so I figured strcat was not what I should be using, I posted here and the kind forum people reassured me that strcat was what was to be used.
"


You should have said that before

Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 2nd Jun 2009 23:19
The one thing you need to be sure of when using functions like strcat and strcpy is that you have enough space in the desitination to hold the necessary number of characters.

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

Login to post a reply

Server time is: 2024-10-01 03:36:23
Your offset time is: 2024-10-01 03:36:23