Introduction to OOP Chapter 15: Overloading : next previous audio real text

Stream Output in C++

Stream output in C++ is a good example of the power of overloading. Every primitive type has a different stream output function.
	ostream & operator << (ostream & destination, int source);
	ostream & operator << (ostream & destination, short source);
	ostream & operator << (ostream & destination, long source);
	ostream & operator << (ostream & destination, char source);
	ostream & operator << (ostream & destination, char *  source);
	// ... and so on

	double d = 3.14;
	cout << "The answer is " << d << '\n';
Intro OOP, Chapter 15, Slide 08