我一直在做數據讀取和創建特定結構的任務。 在一個結構(其本身包含另一個結構)日食顯示「字段」出生'具有不完整的類型「。 我已經通過網絡搜索,但它看起來像有一些具體的錯誤。 (代碼在這裏被縮短版)C中結構和功能的結構
typedef struct{
int birthday_day;
int birthday_month;
int birthday_year;
} birthday;
typedef struct{
int id;
char name[20];
struct birthday birth;
}user;
user usser[100];
int i;
for (i=0;i<100;i++){
fscanf(input, "%s %i %i %i %i", usser[i].id,
usser[i].name, usser[i].birth.birthday_day, usser[i].birth.birhday_month,
usser[i].birth.birthday_year
};
和序列的不同參數。和'scanf'部族需要一個指向參數的指針。 (例如'&usser [i] .id') – BLUEPIXY
BLUEPIXY,謝謝。雖然,我注意到只有在試圖啓動程序 – user3349993