I have for homework assignment to create linked list and menu so user can input new entries as long as he want to. I don't want complete solution, only hints what to do. I can't figure out how to check if head of list(frist element) is allready allocated, i tried:
if (list) AND if (list==NULL) cout << "List allready exist",
Normally, a linked list consists of both a Node class and a List class. The Node classes have the data, including the next pointer, while the List has a pointer to the first Node (and other meta-data if needed). You seem to have mixed up the two (using list->next).
Then, to check if the list is empty, you would do "if(myList.first == NULL)". Your code in the second post checks if the current element is the LAST element (i.e. no 'next' element, thus 'null' next pointer).