R
Ronald A. Andersen
********** header ****************
struct articleFile2
{
char CR;
int intStampDate;
};
*********** source ***************
struct articleFile2 *ptrArticle2 = NULL;
ptrArticle2 = (articleFile2 *)malloc(sizeof(articleFile2));
memset(ptrArticle2, 0, sizeof(articleFile2));
printf("sizeof(struct articleFile2) %d\n", sizeof(struct
articleFile2));
************ Questions************
1) The sizeof function returns 8. Why didn't return 5(i.e. an int is
four bytes and a char is one)?
struct articleFile2
{
char CR;
int intStampDate;
};
*********** source ***************
struct articleFile2 *ptrArticle2 = NULL;
ptrArticle2 = (articleFile2 *)malloc(sizeof(articleFile2));
memset(ptrArticle2, 0, sizeof(articleFile2));
printf("sizeof(struct articleFile2) %d\n", sizeof(struct
articleFile2));
************ Questions************
1) The sizeof function returns 8. Why didn't return 5(i.e. an int is
four bytes and a char is one)?