zeroing structure of char pointers
From: Aaron Walker (ka0ttic_at_cfl.rr.com)
Date: 02/29/04
- Next message: Grant Austin: "Re: 0a appending w/strcpy"
- Previous message: those who know me have no need of my name: "Re: 0a appending w/strcpy"
- Next in thread: Arthur J. O'Dwyer: "[FAQ] Re: zeroing structure of char pointers"
- Reply: Arthur J. O'Dwyer: "[FAQ] Re: zeroing structure of char pointers"
- Reply: Mac: "Re: zeroing structure of char pointers"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 29 Feb 2004 02:44:40 GMT
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
- Next message: Grant Austin: "Re: 0a appending w/strcpy"
- Previous message: those who know me have no need of my name: "Re: 0a appending w/strcpy"
- Next in thread: Arthur J. O'Dwyer: "[FAQ] Re: zeroing structure of char pointers"
- Reply: Arthur J. O'Dwyer: "[FAQ] Re: zeroing structure of char pointers"
- Reply: Mac: "Re: zeroing structure of char pointers"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]