25 lines
479 B
C
25 lines
479 B
C
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
int main() {
|
|
|
|
const char src[20] = "HA! poopoohead!";
|
|
char dest[100];
|
|
|
|
int eh = sprintf(dest, "%s", "goofy");
|
|
|
|
memcpy(dest + 6, 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;
|
|
}
|