im keep getting
ror: expected identifier or '(' before '.' token|error: expected expression before
what am i doing wrong?
#include <stdio.h>
#include <conio.h>
#include <stdint.h>
int main()
{
typedef struct {
char name[20];
char year[20];
int inout[20];
}movie_rent;
movie_rent[20];
int i,sum=0;
FILE *myfile;
if ((myfile = fopen("mov.txt", "rt")) == NULL)
{
printf("error: cannt open\n");
}
for (i=0;i<20;i++)
{
movie_rent[i].inout=0;
}
for ( i=0; i<3; i++)
{
fscanf(myfile,"%c %c %d[^\n]", movie_rent[i].name, movie_rent[i].year,movie_rent[i].inout );
}
for (i=0;i<3;i++)
{
sum=sum+movie_rent.inout[i];
}
printf("%d",sum);
return sum;
}