For example, I have
struct Node
{
string firstName;
string middleI;
string lastName;
string phoneNum;
Node *next;
};
I want to change it so instead of having "struct Node", I change it to "class Node". I feel like what I have isn't right so far, which is:
class Node
{
private:
string firstName;
string middleI;
string lastName;
string phoneNum;
Node *next;
public:
Node(string f, string mi, string sur, string ph){
firstName = f;
middleI = mi;
lastName = sur;
phoneNum = ph;
next = NULL;
}
};
If I were to change from struct Node to class Node, will it affect my linked list functions? (My linked list functions are printing out a linked list and reading in data.)