.mail not .MAILR
you're using:
when it should be:Code:fgets(ptr[i].MAILR.from,120,fp); fgets(ptr[i].MAILR.sub,120,fp); fgets(ptr[i].MAILR.msg,120,fp); fgets(ptr[i].MAILR.spc,120,fp);
and also, you still have the for loop in that function. Get rid of it and just use the i value passed in to the function.Code:fgets(ptr[i].mail.from,120,fp); fgets(ptr[i].mail.sub,120,fp); fgets(ptr[i].mail.msg,120,fp); fgets(ptr[i].mail.spc,120,fp);