How to use calloc() in C?
问题 Shouldn't I get an error if my string goes over 9 characters long in this program? // CString.c // 2.22.11 #include <stdio.h> #include <stdlib.h> #include <string.h> main() { char *aString = calloc(10, sizeof(char)); if (aString == NULL) { return 1; } printf("PLEASE ENTER A WORD: "); scanf("%s", aString); printf("YOU TYPED IN: %s\n", aString); //printf("STRING LENGTH: %i\n", strlen(aString)); } Thanks blargman 回答1: You don't get a compiler error because the syntax is correct. What is