Hello,
I'm trying to read in a txt file that looks like:
AAAA BBBB 1234
CCCC DDDD 4321
....
and here's what I've done so far:
char a[4];
char b[4];
int c;
FILE *input= fopen("input.txt", "r+");
if (input==NULL)
perror ("Error opening file");
else{
while(feof(input)== 0){
fscanf(input,"%4s",a);
fscanf(input,"%4s",b);
fscanf(input,"%d",&c);
}
fclose(input);
}
but after it reads the last string I get "access violation writing location" error. Anyone can point me in a right direction to solve this problem? Thank you!!!