C++ Programming Code Examples C++ > Code Snippets Code Examples Using strcpy() to assign value from one char array to another char array Using string.swap function to swap two strings Using strncpy() and string terminator Using strncpy() to assign one char array to another char array Using strpbrk Using strspn Using strtod: convert string to double Using strtol: convert string to long Using strtoul: convert string to unsigned long Using swap_ranges() in Vector Using template functions to output array of different types Using the bitwise shift operators Using the cin and cout Objects with Arrays Using the cout Object with Numeric Arrays Using the erase Member Function on a Multiset Using the generic sort algorithm with a binary predicate: greater Using the STL generic reverse algorithm with a vector Using the strcpy function Using the Subscript Operator in Programming a Dynamic Array Using the this pointer to refer to object members. Using variable-length argument lists Using Virtual Functions to control the behaviour Using Virtual Methods Utility function for cin Variable Scope Example Demonstrate the use of variables and constants Variables: Global, Local variable Vector assignment Vector Basic: begin(), pop_back(), push_back() Vector Capacity vs size Vector declaration Vector Init Array Vector size before and after elements insertion Vector.begin, vector.end returns the iterators Vector's copy constructor Virtual base classes. Virtual function and public inheritance Virtual function and three level inheritance Virtual function and two subclasses Virtual function for two derived classes Page 1 Page 33 Page 34 Page 35