Examples from http://www.cplusplus.com/doc/tutorial/