Line 37 is not needed. It is a call that is not needed or setup right. Line 37 should look like line 38 if it could be used.
Line 28 the value if i is never changed,so everything goes into input[0]. Also not a good idea to check for "eof" because it does not always work the way you would expect. "eof" is only set after a bad read andby then it could be to late by the time you check for "eof". The code is better written as:
Thank you so much for taking time out of your day to explain the things I wasn't understanding properly. I did exactly what you said and the program runs flawlessly! Also, thank you for explaining eof, I always thought you put eof when reading files. Thank you again, you are awesome!