Mn check lỗi giúp e với !
Ý tường của bài : e muốn khi nhập số lượng tác giả thì sẽ cấp phát cho nó từng đó ô nhớ, nhưng e vẫn chưa thành thạo con trỏ lên vẫn có lỗi
#include<stdio.h>
#include<stdlib.h>
typedef struct{
char nameAuthor[20];
int age;
}author;
typedef struct {
char name[20];
int noOfAuthor;
author *book_author;
int page;
}book;
int main()
{
book b;
gets(b.name);
scanf("%d\n",&b.noOfAuthor);
b.book_author = (author*)calloc(b.noOfAuthor,sizeof(author));
int i=0;
for(i=0 ; i<b.noOfAuthor ; i++)
{
while(getchar() != '\n');
gets((b.book_author->nameAuthor)+i);
scanf("%d",((b.book_author->age)+i));
}
while(getchar() != '\n');
scanf("%d",&b.page);
return 0;
}