I am writing a program that encrypts a text file and then reopens the encrypted text and deciphers it and prints to another text file. Problem is at the end it gives me these two characters: ÿõ. I was thinking it had to do with not closing the file, I even commented out the .close parts and the characters still showed up, so I think its related.
Code:// left out the open output and input files and the initial encrypting file process part. if (outfile.is_open()&& myfile.is_open()) { while (!myfile.eof()) { alpha =myfile.get(); enk =int(alpha) -10; outfile<< char(enk) ; } outfile.close(); myfile.close(); } else cout << "Unable to open file";