On Thu, Mar 5, 2009 at 4:49 AM, Gaurav <[email protected]> wrote:
> eg: String1: "ABC"
> In buffer it will be stored as               buffer[0] = "A"
>                                             buffer[1] = "B"
>                                             buffer[2] = "C"
>
> I now accept 2nd String...
> String2: "XYZ"
>
> I want this string to be stored ahead of ABC i.e as follows:-
>                                             buffer[3] = "X"
>                                             buffer[4] = "Y"
>                                             buffer[5] = "Z"
>
> i.e when I print buffer it should print ABCXYZ and not just XYZ.

Instead of passing in (buffer) to the second call for the address,
pass in (&buffer[strlen(buffer)]).

Watch out for buffer overflows though.

-- 
PJH

http://shabbleland.myminicity.com/ind
http://www.chavgangs.com/register.php?referer=9375

Reply via email to