Since you didn't post any code we can only guess that you are attempting to write back to the file that you read from. You can't do it that way. Open a different file for output then read a character from input file and write the morse code to the new output file.
BTW you don't need an interator. Depending on how you set up the vector you can index directly into the vector using the english character as the index value. Example:
string code = array['A'];
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
>>the problem is I not allowed to use arrays.
vector is an array.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343