So i wanna know how to use fscanf with array struct. So this is my struct
struct menuinput{
char nama[50];
int nomor;
int berat;
int jumlah;
int pilihan;
float kalori;
float totalkkal;
}mknpokok[20],mknsayur[20],mknspsj[20],mknlaukpauk[20],mknbuah[20];
And i wanna use it in file scan using fscanf, as far as i know file scan command is like this
while(!feof(fp))
{
fscanf(fp,"\n%d %[^\n] %d %.3f",&mknpokok.nomor[i],mknpokok.nama[i],&mknpokok.berat[i],&mknpokok.kalori[i])
i++;
}
When i run that i get this error message
error: '(struct menuinput *)&mknpokok' is a pointer; did you mean to use '->'?
I forget how to fscanf with array struct, so is what am i doing is correct? if wrong please correct it with the right code, thank you.