character classification using C++ streams