How to implement a single item for a linked list class? C++ homework : I'm extremely new to C++, so I wanted to get some help on a homework problem that I've been working on for the past few hours. The criteria of the problem is this: 

In the problems below, we will be implementing a list of "items."  In this problem, we will create an Item class for this purpose.

To make things a little interesting, we will have two components to our Item: (1) an integer key and (2) a literal string value.

Your class must include:

[2.5 pts] Private member variables for the key (int) and value (const char *).  Don't allocate space for the string -- just keep a pointer.

[2.5 pts] A public constructor that initializes the key and value.  Again, don't copy the string that is passed in -- just save the pointer.

[2.5 pts] Public methods to read the key and value -- e.g., getKey(), getValue().

[2.5 pts] A public copy constructor.


I'm extremely confused on how to implement the third and the fourth bullet point. I'll attach my code below, if any of you guys could tell me what I'm doing wrong or how I go about implementing these parts that would be awesome. The reason I'm confused is because I'm not exactly sure what they are designed to do.

    class Item {
        Private:
            int key;
            const char* point;
        Public:
            Item(int key, char* point); //I'm not sure when to put brackets after a constructor? The examples given are usually pretty vague.
            getKey(key); //What do these do? We never went over these in class? What is the point?
            getValue(point);
            Item(const Item &new) {
                key = new.key;
                value = new.imaginary;
            }
    };

Like I said, I am very, very new to C++, so any pointers would be helpful. Thank you so much!



