Question: I have a question about this question Define a class named MyString to define the string type (i.e. a sequence of characters) based on the
I have a question about this question
Define a class named MyString to define the string type (i.e. a sequence of characters) based on the following specification: 1. This class declares two attributes to represent a string in memory: a character pointer that holds the start address of the string in memory and an integer that holds the length of the string. NOTE This is not a null-terminated string; do not assume any null character showing the end of a string in memory. 2. This class uses dynamic allocation to prevent wasting memory. In other words, a string including the word hello will take only 5 bytes for its characters and no more byte is reserved or wasted. Try to Answer:
How many bytes are taken by a MyString object based on this implementation?
How many bytes are wasted?
How many bytes are you using for your real data?
How many overhead bytes are you considering?
I don't have any idea these question above. Please tell me the answers and also the reasons
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
