logo
Course thumb

The C programming language made simple

Difference between memmove and memcpy

#include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char* argv[]) { char str[] = "Start stop"; printf("%s\n", str); memmove(str, str + 2, 3 * sizeof(char)); // memcpy(str, str + 2, 3 * sizeof(char)); printf("%s\n", str); return 0; }