Using stl sort

Never write your own sort! Use the the sort in the Standard Template Library (STL). The STL has sorts that are efficient and well tested. Basic syntax for calling sort When calling the STL sort, you need to pass two parameters: the address of the first element to sort, and the address of one past the last element to sort. The address is used for iterating across array elements. For other data structures (eg, a vector) you will have to do something a little different, but for arrays we can simply express the beginning and ending points with the array name and the addition of an integer. [Read More]

String Class in cpp(Standard cpp strings)

Here is how to test the string class already present in cpp. To use simple strings u have to include . For example consider the program, #include #include <conio.h> using namespace std; int main() { string word="hello”; cout«word; getch(); } There are various functions and operators in this string class. These operators are present in string - = assignment + , += concatenation etc == , != . < , <= , >= , > equality etc. [Read More]