This commit is contained in:
Win 2024-05-22 15:07:11 +07:00
parent 0ac77260b3
commit 3513468ecf
2 changed files with 25 additions and 0 deletions

BIN
goffy Executable file

Binary file not shown.

25
goffy.c Normal file
View File

@ -0,0 +1,25 @@
#include <stdio.h>
#include <string.h>
int main() {
const char src[20] = "HA! poopoohead!";
char dest[100];
int eh = sprintf(dest, "%s", "goofy");
printf("%d\n", eh);
memcpy(dest + eh, src, strlen(src) + 1);
printf("Output: %s\n", dest);
printf("src[0] %p\n", &src[0]);
printf("src[0] %p\n\n", src);
printf("src[1] %p\n", &src[1]);
printf("src[1] %p\n", src + 1);
printf("src[50] %p\n", src + 49);
printf("%ld", sizeof(dest));
return 0;
}