home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!wupost!csus.edu!netcom.com!netcomsv!ulogic!hartman
- From: hartman@ulogic.UUCP (Richard M. Hartman)
- Newsgroups: comp.lang.c
- Subject: Re: Problem with string processing.
- Message-ID: <811@ulogic.UUCP>
- Date: 6 Jan 93 01:44:52 GMT
- References: <1993Jan4.022737.19792@kpc.com> <2mqVwB6w165w@cybrspc.UUCP> <MCGLK.93Jan5005833@yang.cpac.washington.edu>
- Distribution: usa
- Organization: negligable
- Lines: 25
-
- In article <MCGLK.93Jan5005833@yang.cpac.washington.edu> mcglk@cpac.washington.edu (Ken McGlothlen) writes:
- >Roy M. Silvernail (roy%cybrspc@cs.umn.edu) writes:
- >+----------
- >| [regarding the C statment: while (*ptr++ = *str++); ]
- >|
- >| (nice touch, BTW) How does this differ from 'strcpy(ptr, str)' besides the
- >| function call overhead?
- >+----------
- >
- >It doesn't. In fact, that's often how strcpy() is implemented.
-
- Actually, on systems w/ block memory move supported at the
- CPU level, memcpy() can be implemented much more efficently.
- If there were a decent way of getting the string length w/o
- counting all the bytes then direct support for strcpy() could
- be done easily. Are there any CPUs that have a single-instruction
- way of saying "find the next 0 byte & tell me how far it was from here"?
-
-
-
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- And when you stop and think about it |
- (you won't believe it's true) | -Richard Hartman
- That all the love you've been giving | hartman@uLogic.COM
- has all been meant for you. |
-