C++ Programming Code Examples C++ > Code Snippets Area of rectangle Average function Average Cin example Cin getline example Cout and cin examples Cout width example Creates a file using fstream Enum example Fahrenheit to celsius conversion File example using fstream.h functions Function example If - Else example Launch notepad using C++ Multiply a number by a power Octal - Hexadecimal - Decimal conversion Octal, hex and decimal conversion example 2 Open a file and display contents on the screen Get the OS version on your PC Read a character using cin Write a character using cout Write text to a file A base pointer to access derived objects A C++ program with several functions A Class as a Member Variable of Another Class A classical stack operation using a string of characters. A Closer Look at the I/O Operators A copy constructor to allow StringClass objects to be passed to functions. A dynamic output array A filter to remove white-space characters at the ends of lines. A four-function postfix calculator. A function object that computes an integer sum. A generic bubble sort. A generic mode finding function. A generic stack that holds two values. A generic stack that includes exception handling. A generic version of myabs(). A list splicing example. A map: insert pair, find, end A map of opposites. Page 1 Page 2 Page 35