c memcpy

Solutions on MaxInterview for c memcpy by the best coders in the world

showing results for - "c memcpy"
Omar
26 Jun 2018
1int dst[ARRAY_LENGTH];
2memcpy( dst, src, sizeof(dst) ); // Good, sizeof(dst) returns sizeof(int) * ARRAY_LENGTH
Adriel
23 Aug 2016
1void *memcpy(void *dest, const void * src, size_t n)
Mads
06 Jan 2020
1#include <stdio.h>
2#include <string.h>
3
4int main () {
5   const char src[50] = "http://www.tutorialspoint.com";
6   char dest[50];
7   strcpy(dest,"Heloooo!!");
8   printf("Before memcpy dest = %s\n", dest);
9   memcpy(dest, src, strlen(src)+1);
10   printf("After memcpy dest = %s\n", dest);
11   
12   return(0);
13}