i have written the following code for an add fucntion for a linked list implementation. when i run it, it runs correctly. when i went to class today, i found i had made a mistake. my add function adds only a student data type, whereas the assignment was to make the add function able to add a student(string), a university (string) and an id(int).
how can i modify my code in order to satisfy this?
any help is appreciated.
thankyou!
ps. if i didnt explain myself correctly, ill be more than happy to provide more details.
this is my code:
void add(string student)
{
//create a new node
studentnode * somenode;
somenode = new studentnode;
//put student in the new node!
somenode->data = student;
//put new node at front of list!
somenode->next = start;
start = somenode;
}