结构体的问题
struct book{
char name[10];
char no[10];
};
这里的sizeof(struct book)应该是多少?这里的内存是怎么算?是根据char来计算?还是用数组10来计算?
程序代码:
#include "stdio.h"
#include "stdlib.h"
struct book
{
char name[10];
char no[10];
};
int main(void)
{
int a;
a=sizeof(struct book);
printf("%d",a);
system("pause>nul");
return 0;
}