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

using std::string;

int
main()
{
	char	*p	= "hello world";
	string	 s1	= string(p + 3, p + 8);
	string	 s2;

	copy(p, p + 5, back_inserter(s2));

	std::cout << s1 << std::endl;	// "lo wo"
	std::cout << s2 << std::endl;	// "hello"

	return 0;
}
