[glug-t] Re: Hacking in C
- From: Aashish Ramdas <aashish_ramdas@xxxxxxxxx>
- To: glug_t@xxxxxxxxxxxxx
- Date: Sun, 3 Apr 2005 22:06:41 -0700 (PDT)
This can be solved:
char *p = str1;
while( *p++ = *str2++ );
return str1;
Usually this is put inside a function, so the changed value of str2
is within the function call only.
Of course, all this is assuming that str1 is pointing to some valid
memory, and is adequate...
Aashish
--- palaniappan chellappan <palam_analog@xxxxxxxxxxx> wrote:
> Here is one of the solution,
>
> while( *str1++ = *str2++ );
>
> The only problem in this solution is str1 and str2
> won't point to the string after copying it.
>
>
> --- Vijay Kumar <vijaykumar@xxxxxxxxxxxx> wrote:
> > Here is a simple task which is not trivial in C -
> > You have two char
> > pointers str1 and str2. str2 points to a string,
> > which has to be copied
> > to a buffer pointed to by str1.
> > Regards,
> > Vijay
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Personals - Better first dates. More second dates.
> http://personals.yahoo.com
>
> ---------------------------------------------------------------
> To unsubscribe send a mail to glug_t-request@xxxxxxxxxxxxx with
> 'unsubscribe' as subject.
>
> Website: http://glugt.linuxisle.com
>
"The mind is a figment of its own imagination"
__________________________________
Yahoo! Messenger
Show us what our next emoticon should look like. Join the fun.
http://www.advision.webevents.yahoo.com/emoticontest
---------------------------------------------------------------
To unsubscribe send a mail to glug_t-request@xxxxxxxxxxxxx with
'unsubscribe' as subject.
Website: http://glugt.linuxisle.com
- Follow-Ups:
- [glug-t] Re: Hacking in C
- From: Vijay Kumar
Other related posts:
- » [glug-t] Hacking in C
- » [glug-t] Re: Hacking in C
- » [glug-t] Re: Hacking in C
- » [glug-t] Re: Hacking in C
- [glug-t] Re: Hacking in C
- From: Vijay Kumar