#include #include #include // memset int main() { char *name = NULL; name = (char *)calloc(4, 8 * sizeof(char)); // 说明: 4 * 8 = 32 if (NULL == name) perror("calloc"); scanf("%s", name); printf("%s\n", name); free(name); return 0; }