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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!