Question
Please help fill in the code to implement an array class for characters. /* Comments help to know what to do in each function. Needs
Please help fill in the code to implement an array class for characters. /* Comments help to know what to do in each function. Needs to be in C++
/**
* Retrieve the current size of the array.
* @return The current size
*/
size_t size (void) const;
/**
* Retrieve the maximum size of the array.
* @return The maximum size
*/
size_t max_size (void) const;
/**
* Get the character at the specified index. If the index is not
* within the range of the array, then std::out_of_range exception
* is thrown.
* @param[in] index Zero-based location
* @exception std::out_of_range Invalid \a index value
*/
char & operator [] (size_t index);
/**
* @overload
* The returned character is not modifiable.
*/
const char & operator [] (size_t index) const;
/**
* Get the character at the specified index. If the \a index is not within
* the range of the array, then std::out_of_range exception is thrown.
* @param[in] index Zero-based location
* @return Character at \index
* @exception std::out_of_range Invalid index value
*/
char get (size_t index) const;
/**
* Set the character at the specified \a index. If the \a index is not
* within range of the array, then std::out_of_range exception is
* thrown.
* @param[in] index Zero-based location
* @param[in] value New value for character
* @exception std::out_of_range Invalid \a index value
*/
void set (size_t index, char value);
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started