/*Orion Lawlor's Simple STL Examples, olawlor@acm.org
Shows how to use std::for_each.
*/
#include <iostream>
#include <algorithm>

void print(const char *str) {
	std::cout<<str<<std::endl;
}

int main()
{
	const char *start[]={"foo","bar","baz"};
	const int len=sizeof(start)/sizeof(start[0]);
	const char **end=&start[len];
	
	std::for_each(start,end,print);
	return 0;
}
/*<@>
<@> ******** Program output: ********
<@> foo
<@> bar
<@> baz
<@> */
