So far I can see a missing quote on line 9, and on line 15
for(int i=0; i <= 30; i++)
i will iterate to 30, and 30 would be out of bounds, an array starts from 0, so stop it when it gets to 29
for(int i = 0; i < 30; i++)
Without knowing the format of the input file, I can't comment on whether you're reading the file correctly.
Have you tried displaying the contents of rainyshine to confirm you're reading the file correctly?
Your code won't compile.
Line 9: You're missing an opening ".
You have a problem with your loops at lines 12-25.
line 13: rainyshine is an uninitialized array. i.e. it contains garbage when main() is entered.
Line 18: You're checking for a space and if you read a space, you skipping initializing rainyshine, thereby leaving garbage in that cell.
Last edited on