What is the difference between doing:
ptr = (char **) malloc (MAXELEMS * sizeof(char *));
or:
ptr = (char **) calloc (MAXELEMS, sizeof(char*));
When is it a good idea to use calloc over malloc or vice versa?
转载于:https://stackoverflow.com/questions/1538420/difference-between-malloc-and-calloc