It may be because the your program reads an additional word and trying to assign it to your array. With this loop, you ensure that only 10 words are allowing to be read.
Another thing, next time use [code][ /code] wrapper to make your code readable, and use indents.
The problem is that you are writing outside array boundaries when the file contains more than 10 characters.
Either add a condition to your loop checking that counter is not less than 0 or use ifs.read http://www.cplusplus.com/reference/iostream/istream/read/