Let me ask this: What would happen if u tried to open something u know to be a video with a text file program like wordpad ? It's a similar issue here.
.in and .out are not standard extensions for string output. Make it easy and use .txt
don't loop on fin.eof(), loop on fin.good() or on getline.
This is probably your problem. I don't know what the string value will be if getline fails. Is it implementation defined? After your while loop at least one of the calls to getline will have failed so it could be that your strings contain a value that you don't expect.