I have a problem that ı could not understand.
#include <cstdlib>
#include <iostream>
#include <stdio.h>
using namespace std;
struct record
{
char name [20];
double ave;
};
int main(void)
{
int x,y;
struct record array1[3];
struct record array2[3];
FILE *a;
a=fopen("in.txt","r");
for (int i=0;i<3;i++)
{
fscanf(a," %d",&y);
array1[i].ave=(x+y)/2.0;
cout << y <<endl;
}
system("PAUSE");
return 0;
}