So what i did before writing the program was to creat the file MyFile on my desktop with my input data in it. THE PROBLEM HERE IS THAT MY PROGRAM DOESN'T SEEM TO FIND THIS FILE, i don't know if its because of the location of the file. please help me.
The file must be in the Current Directory (which is the directory of your project). Try this, move the file to, say,
drive D, the in_stream.open("D:\MyFile.dat") must be successful. If the operation is successful, then as I said earlier, you need to put your file in the Current Directory, if the operation fails, then its probably due to wrong extension. Check if your MyFile.dat actualy is MyFile.dat (with dat extension) or if you created it in notepad, it could be MyFile.dat.txt. This too can cause problems
............................................
.doc files are encoded in Micro$oft's proprietary format. You can't read ascii characters from that like a normal text file.