home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / c / 19220 < prev    next >
Encoding:
Text File  |  1993-01-05  |  1.1 KB  |  31 lines

  1. Path: sparky!uunet!spool.mu.edu!umn.edu!cybrspc!roy
  2. From: roy%cybrspc@cs.umn.edu (Roy M. Silvernail)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Problem with string processing.
  5. Message-ID: <2mqVwB6w165w@cybrspc.UUCP>
  6. Date: Mon, 04 Jan 93 19:14:36 CST
  7. References: <1993Jan4.022737.19792@kpc.com>
  8. Organization: Villa CyberSpace, Minneapolis, MN
  9. Lines: 20
  10.  
  11. hollasch@kpc.com (Steve Hollasch) writes:
  12.  
  13. >             while (*ptr++ = *str++);    /* Note assign op and null body. */
  14.  
  15. (nice touch, BTW)  How does this differ from 'strcpy(ptr, str)' besides
  16. the function call overhead?
  17.  
  18. And just for the heck of it....
  19.  
  20. Assuming a large enough string for the append, and low-high byte ordering,
  21. would this work?
  22.  
  23. strcat(str,(char *)&ch);
  24.  
  25. (or have I been drinking too much coffee again? :-} )
  26. --
  27.     Roy M. Silvernail   | #include <stdio.h>                 | "press to test"
  28.  roy%cybrspc@cs.umn.edu | main(){                            |     <click>
  29.  cybrspc!roy@cs.umn.edu |  float x=1;                        | "release
  30.                         |  printf("Just my $%.2f.\n",x/50);} |    to detonate"
  31.