![]() |
![]() |
![]() |
copy a number of characters from one buffer to another
#include <string.h> void *memcpy( void *dst, const void *src, size_t length ); void __far *_fmemcpy( void __far *dst, const void __far *src, size_t length );
The memcpy() function copies length characters from the buffer pointed to by src into the buffer pointed to by dst.
![]() |
Copying of overlapping objects isn't guaranteed to work properly. See the memmove() function if you wish to copy objects that overlap. |
The _fmemcpy() function is a data-model-independent form of the memcpy() function. It accepts far pointer arguments, and returns a far pointer. It is most useful in mixed memory model applications.
A pointer to the destination buffer (that is, the value of dst).
#include <stdio.h> #include <string.h> void main() { char buffer[80]; memcpy( buffer, "Hello", 5 ); buffer[5] = '\0'; printf( "%s\n", buffer ); }
Safety: | |
---|---|
Interrupt handler | Yes |
Signal handler | Yes |
Thread | Yes |
memchr(), memcmp(), memicmp(), memmove(), memset()
![]() |
![]() |
![]() |