Error is this :
C:\Program Files\PellesC\Projects\Tekrar denemeler\dene\dene.c(26): fatal error: Internal error: 'Access violation' at 0x00483798.
Code:
#include <stdio.h>
#include <string.h>
int main()
{
typedef struct string {
char bir[41];
char iki[41];
int section;
} ara;
FILE *fp;
fp=fopen("liste.txt","r");
char a[41];
int x=0;
while((fgets(a,40,fp))!=NULL) {
x+=1;
}
int b=0;
rewind(fp);
ara kayit[x];
int i=-1;
for(b=0;b<x;b++) {
if((b % 3)==0) {
i++;
kayit[i].section=(b/3)+1;
fgets(kayit[i].bir,40,fp); }
if((b % 3)==1) {
fgets(kayit[i].iki,40,fp); }
}
for(i=0;i<((x+1)/3);i++) {
printf("Section %d\n%s\n%s\n",kayit[i].section,kayit[i].bir,kayit[i].iki);
}
return 0;
}
What the program does is not important , I just want to know what is my fault here as a fault error?