I'm Using FILE * F opened in _sfopen () I'm reading from the file in while(!feof(f)) and then fgets(str,1024,f) when running reaches the last line it still goes in the while but then when trying to fgets it flies out with an access violation arror (menwhile I just put a try and catch(...) but I know It's not a good solution ) what shoul I change for fixing the problem?
Plus- if I want to read line by line is it correct just to give the size of 1024 or it might fail -- I had a file where due to the size it read each time from the middle of a line till the middle of next line - is there a better way to read a line because I have no idea how my files will look like (if the have \n at the end etc...)
thanks!