A
Aaron Walker
I was just wondering, if I have:
struct my_struct {
char *str1;
char *str2;
};
and then elsewhere do:
struct my_struct *ms = calloc(1, sizeof(struct my_struct));
Would that be the same as doing:
struct my_struct *ms = malloc(sizeof(struct my_struct));
ms->str1 = ms->str2 = NULL;
Thanks,
Aaron
struct my_struct {
char *str1;
char *str2;
};
and then elsewhere do:
struct my_struct *ms = calloc(1, sizeof(struct my_struct));
Would that be the same as doing:
struct my_struct *ms = malloc(sizeof(struct my_struct));
ms->str1 = ms->str2 = NULL;
Thanks,
Aaron