Your second code opens file "in" and reads 164 characters, and its a very preliminary encryption algorithm, I think. It reads a character, and substitutes another character in place of it. What seems to be the problem with the code?
Edit: Just now saw the post, you can use something like this:
Code:
while(streamhandle)
{
//blah blah
}
example:
while(in)
{
//do all stuff
}
This would work as long the stream has data, and end of file has not been reached.
And about your second question, what have you tried to do about standard c++ and what error do you receive? please be clear.