#include <iostream>
#include <string>
#include <algorithm>
#include <iterator>

void f( char c) {
	c = c + 1; // do your processing
	std::cout << c << std::endl;
}

int main()
{
	std::string str = "string";
	for ( int i = 0; i < str.length(); ++i)
    std::cout << str[i] << std::endl;
    
    std::copy( str.begin(), str.end(), std::ostream_iterator<char>( std::cout, "\n"));
    
    std::for_each( str.begin(), str.end(), f);
    
    return 0;
}