C Programming Language |
malloc |
calloc |
memset |
memcpy |
memory |
strcpy |
string |
strtok |
isalnum |
cctype |
errno |
cfenv |
clock |
difftime |
mktime |
ctime |
fprintf |
fscanf |
printf |
scanf |
stdio |
math |
defined in string.h
void *memcpy( void * destPointer, const void * srcPointer, size_t n);
memcpy(), copies n bytes of memory from source pointer to destination pointer.
destPointer : the destination pointer where the memory needs to be copied.
srcPointer : the source pointer of the memory.
n : number of bytes to be copied.
The memcpy() function returns a pointer to destPointer variable.
#include <stdio.h>
#include <string.h>
int main ( int argc, char* argv[])
{
char source_str[] = "Test Messages";
char dest_str[100];
memset( dest_str, 0, sizeof(dest_str));
memcpy( dest_str, source_str, sizeof(source_str));
printf("%s\n", dest_str);
return EXIT_SUCCESS;
}
zalloc is a third party library
posted on 2018-12-12 20:46:30 - C Programming Language Tutorials
posted on 2017-12-29 22:52:47 - C Programming Language Tutorials