Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write your own simplified version of the std::string class, with the following specification. Please put the class definition on page 3 , and the implementation

image text in transcribed
Write your own simplified version of the std::string class, with the following specification. Please put the class definition on page 3 , and the implementation of the member functions on page 4 . You may use any of the standard C string library functions; you may assume that c cstring > is already included. You may not use the C++ library. Specification: - Class name is MyString. - Must include a default constructor, which initializes to an empty string. - Must include a destructor. - Must include a parameterized constructor, which takes a const char " and copies the string data into the object. - Member functions: empty - returns true if it's an empty string, false if non-empty size - returns the length of the string (does not include the null terminator) contains - takes either a character (char) or a string (const char *), returns true if the character or substring appears anywhere in the string, false otherwise

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Relational Model A Retrospective Review And Analysis

Authors: C. J. Date

1st Edition

0201612941, 978-0201612943

More Books

Students also viewed these Databases questions