TIP: Click on subject to list as thread! ANSI
echo: locsysop
to: Roy McNeill
from: Paul Edwards
date: 1995-04-26 23:27:16
subject: C

BL>   For instance... what's the difference between strcpy and stpcpy? Can
BL> you remember? I can't, and I've just looked it up.

RM> Different return value. char *s=stpcpy(dest,source) points to the
RM> end of the new string, char *s=strcpy(dest,source) points to the
RM> beginning. stpcpy() could be handy if you're concatenating a number
RM> of stringlets into dest, although I've never used it (thinks - a
RM> bit fiddlier than strcat, but slightly faster in a loop - strcat
RM> has to find the end of dest before it can start copying, stpcpy()
RM> has already supplied the end pointer). Btw, virtually all C
RM> library functions return a value, we just don't use all of them.

RM> stpcpy() does overlap strcat() a bit, and strcpy() a lot. I call
RM> this a bonus, not a drawback. English is a rich language partly
RM> because of its large collection of synonyms (you intellectually
RM> challenged vagina ); something similar can be said about C.

stpcpy() is not part of the C standard.  The other two are though.
BFN.  Paul.
@EOT:

---
* Origin: Kludging up the works (3:711/934.9)

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.