Implementing fa unction that adds and sorts data in a singly linked list (addsort)?
问题 I'm very new to C++ so it's a bit hard to understand the syntax sometimes. Anyways, I'm supposed to implement a function that adds and sorts the data given into a linked list. For example if I pass 2 into the list [1,4,5] then I should get [1,2,4,5] Here is what I have written so far, and no it does not work, I keep getting "blah blah not declared in this scope" void addSorted(Data * ){ temp = 0; if (head == NULL) { head = new LinkNode(newData); } else { LinkNode * current = head; while