All examples from http://www.cplusplus.com