Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>memmove() copy characters between buffers</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 memmove()               Copy characters between buffers

 #include   <string.h>

  void *memmove(dest, source, count);
  void *dest;            Destination buffer
  const void *source;    Source buffer
  size_t count;               Number of characters to copy

    memmove() copies count characters from source to dest. If parts of
    source and dest overlap, the original source characters are properly
    copied before being overwritten.

    Returns:    memmove() returns the value of dest.

      Notes:    memmove() insures that overlapping regions will be
                handled properly, at some loss of speed. For non-
                overlapping regions, memcpy() will provide quicker
                transfer.

   Portability:     ANSI

 -------------------------------- Example ---------------------------------

 /*This program copies source to dest, where dest begins within source*/

           #include <string.h>

           char source[100] = "Memmove() will properly shift this string.";

           main()
           {
              char *return_val;
              size_t count;

              count = strlen(source);

              printf("Source: Address = %u, String = %s\n", source, source);
              return_val = memmove( (source + count / 2), source, count);
              printf("Dest  : Address = %u, String = %s\n",  (source + count
                  / 2), (source + count / 2));
           }


See Also: memcpy() memccpy()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson