hi can someone give this a quick look over and tell me where im going wrong
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
void main()
{
struct Rainfall{
char city[20];
int month;
int rainfall;
};
Rainfall Rainfallarray[18];
int count=0;
FILE * readfile;
readfile=fopen("CityRain.txt","r");
if(readfile==NULL)
{
printf("CityRain.txt failed to open.");
exit(1);
}
printf("CityRain.txt Opened\n");
while(!feof(readfile))
{
fscanf(readfile, "%[^,],%d,%d%*c",Rainfallarray[count].city,Rainfallarray[count].month,Rainfallarray[count].rainfall);
count++;
printf("In loop%d",count);
}
fclose(readfile);
system("pause"); //OMG MORE RANDOM COMMENTS
}
im getting
Unhandled exception at 0x6fdde30e (msvcr100d.dll) in Assingment.exe: 0xC0000005: Access violation writing location 0xcccccccc.