I need someone to answer one quick homework question about C++ and data structures. Below, you will find the question. If you know how to answer it, I will provide the notes that is being used for the question from Feb 2. Thanks!
3. In class on Feb 2, we spent time covering memory management inside a class in the context of a word class. For the word class that we began to develop, provide a complete and correct implementation of methods that are required in a class which manages memory. [15 points]
class word
{
private:
char* data; //a pointer to the characters
int len; //number of characters in the string
public:
word(char* init)
{
len = strlen(init);
data = new char[len + 1];
strcpy(data, init);
}
//provide the implementation for any other required
//methods for this class here.
};
Hi, I have read the requirements and I would like to do this project if given the opportunity. I know C++ very well, especially classes. Let me know if you are interested so I can have the complete details. Thanks.
hello.
i saw your code.
i can to it in a hour or 30 minutes.
please contact me and explain more.
bye.
================
class word
{
private:
char* data; //a pointer to the characters
int len; //number of characters in the string
public:
word(char* init)
{
len = strlen(init);
data = new char[len + 1];
strcpy(data, init);
}