character convertion using C++ streams