String Bound Exceptions
Write a class BCheckString that is derived from the STL string class. This new class will have two member functions:
A) A BCheckString(string s) constructor that receives a string object passed by value and passes it on to the base class constructor.
B) An char operator[](int k) function that throws a BoundsException object if k is negative or is greater than or equal to the length of the string. If k is within the bounds of the string, this function will return the character at position k in the string.
You will need to write the definition of the BoundsException class. Test your class with a main function that attempts to access characters that are within and outside the bounds of a suitably initialized BCheckString object.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.