-
So now that you've fixed that, how's the size? How are you checking when you say it prints out the wrong number? Make a file with:Save it. Load it. What's your answer? Do you have a newline after the 5? Try it with and without. Note the 'size'. Just make a file that does only that. Open, count the newlines, close, print the size.
Quzah.
-
> lines I had a "incompatible types in assignment" error so I add the "*"'s.
Yeah, my mistake :(
You would need char **a to make swapping pointers possible. (*a)[50] are still arrays, so you still have to use the strcpy() approach you had previously.
I can't see anything wrong with your line counter, apart the the already mentioned =100
Try debugging with really small files (like one or two lines) and see what results you get.
Beware that lots of trailing blank lines will likely make your code fail in it's present form.