I'd guess that your "file.txt" file isn't being opened correctly.
You need to check fileIn.is_open() before doing anything else as fileIn.eof() won't tell you if the open failed - you'll just end up going round and round the while loop.
umm first of all don't use system pause because it is evil. second could it be that the while loop works until end of file is reached and I don't see where eof is made true thus the infinite loop. I dont really understand eof though so i could be wrong