Write a class BCheckString that is derived from the STL string class. This new c
ID: 3624452 • Letter: W
Question
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 andpasses it on to the base class constructor.
B) An char operator[](int k) function that throws a BoundsException object if k is negative or 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 BoundsExceptin class. Test you class with a main function that attempts to access characters that are within and outside the bounds of a suitably initialized BCheckString object.
Explanation / Answer
a
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.