(C++) Doubly Linked List Template - Access Problems -


I am very new to C ++ templates. I am currently working on a project where I am using a template Doubles need to implement the linked list. Currently what I still have:

  template & lt; Category item type & gt; Class sort list {public: sorted list (); ~ SortedList (); Enter the bowl (to type the item type); Remove boolean (to type itemtype); Zero print (); Private: Sorted list (constant sorted & amp; copyFrom); Sort list & amp; Operator = (Custed Sorted & Assignment); Structure node {node (item type type, node * p = null, node * n = null) {data = item; Prev = p; Next = n; } Item type data; Node * prev, * next; }; Node * list; }; Template & lt; Category item type & gt; Sorted list & amp; Lt; Item type & gt; :: Sort list () {list == faucet; } Template & lt; Class item type & gt; Sort list & lt; Item type & gt; :: ~ sort list () {node * curr = list; While (curr! = NULL) {node * tempNext = curr- & gt; next; Turn off; Current = tempNext; }}  

However, in my ruin, for example, why can not I use node elements? The code inside the code which is currently compiled, but does not throw errors though, if I try to use on -> curr, then the next or the last does not appear, why do not I have access to these? I feel like I'm doing something very special to start.

Also, how can I start the list == in function head instead of outside the square?

  1. I do not know why it compiles, but you are using

Delete current; Current = tempNext;

Instead of:

  delete delete; Curr = tempNext; Use inline initial syntax:   

class classified list {public: sorted list}: list (nullptr node (this is more optimal) to begin the same syntax Use <}

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -