#include <string> #include <iostream> int main(){ std::string test = "test string"; typedef std::string::iterator iter_type; for (iter_type it = test.begin(); it != test.end(); ++it){ switch (*it){ case 'a' : case 'i': case 'u':case 'e': case 'o': std::cout << " vocal " << *it; default :std::cout << " konsonan " << *it; } } }