home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / c / 16597 < prev    next >
Encoding:
Text File  |  1992-11-16  |  1.2 KB  |  49 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!murphy!gregb
  3. From: gregb@murphy.com (Greg Banschbach (Unigroup of New York))
  4. Subject: Re: Memory functions  -  memcpy & memmove
  5. Message-ID: <BxtE16.2HG@murphy.com>
  6. Organization: Murphy & Durieu, NYC NY, USA
  7. References: <1992Nov10.162211.7073@atlastele.com>
  8. Date: Mon, 16 Nov 1992 15:07:53 GMT
  9. Lines: 38
  10.  
  11. In <BxArt0.9pE@murphy.com>, I wrote a question which got this 
  12.  reply,  which seems to work, AND in addition tells me I need
  13.  to look at some of the B-tree node / leaf routines to find the
  14.  root of my problem:
  15.  
  16.     THANKS VERY MUCH FOR ALL OF THE RESPONSES......
  17.  
  18. From adam.MIT.EDU!scs Sat Nov  7 23:14:03 1992
  19. From: scs@adam.mit.edu (Steve Summit)
  20. To: gregb@murphy.com
  21. Subject: Re: Memory functions  -  memcpy & memmove
  22.  
  23. In <BxArt0.9pE@murphy.com>, you wrote:
  24.  
  25. >         Has anyone written a function which would exactly mimic
  26. >     memmove ?
  27.  
  28. Here's the one I use on systems without it:
  29.  
  30.     memmove(dest, src, len)
  31.     register char *dest, *src;
  32.     register int len;
  33.     {
  34.     if(src < dest)
  35.         {
  36.         src += len;
  37.         dest += len;
  38.         while(len-- > 0)
  39.             *--dest = *--src;
  40.         }
  41.     else    while(len-- > 0)
  42.             *dest++ = *src++;
  43.     }
  44.  
  45.                     Steve Summit
  46.                     scs@adam.mit.edu
  47.  
  48.  
  49.