#include <stdio.h>
#include <string.h>
struct Testscanf
{
char input[20];
char intput1[3];
};
int main() {
char input[] = "John 25";
char intput1[] = "12";
printf("%p %p\n", (void*)input, (void*)intput1);
struct Testscanf testscanf;
strcpy(testscanf.input, "John 25");
strcpy(testscanf.intput1, "12");
printf("%p %p\n", (void*)testscanf.input, (void*)testscanf.intput1);
return 0;
}
在windows下运行结果
000000b1b81ffa18 000000b1b81ffa15
000000b1b81ff9f0 000000b1b81ffa04