title: Create and print a Linked list
body: <pre><code>#include &lt;iostream&gt;     
        
  using namespace std;
  struct node   
  {      
      int num;   
      node * next;   
  };
  //Create a list, if list is not empty have at least first middle and last node
  void cList (node *);
  //inserts a node
  void iANode(node *);
  //Inserts in order
  void iIOrder(node *);
  
  void main(){
      int numM;   
      node *list, *current;   
      list = new node;   
      current = list;
      cout&lt;&lt;&quot;Input&quot;&lt;&lt;endl;
      cin&gt;&gt;numM;
  
      //creates a list
      void clist(node * record){
          node * head = new node;
          (*head).d1=0;
          (*head).next =0;
          return head;
      }
  
      //inserts a node
      void iANode(node * record)
      {
          (*newnode).next = (*pred).next;
          (*pred).next= new node;
          ++(*phead).counter;
      }
  
      //inserts in order
      void iIOrder(node * new node, node*head){
          node *pred = head;
          int i = (*new node).d1;
          node*succ=(*pred);
      }
  }
  </code></pre>
  <p>I am trying to create a linked list and sorting it after each user input.</p>
  <p>Currently getting a whole lot of compile errors. Id appreciate if someone could help and point me in the right direction.</p>
  <p>Thanks in advance.
  Compile Errors:</p>
  <blockquote>
  <p>Local function definitions are illegal for &quot;cList&quot; and &quot;iANode&quot;</p>
  <p>&quot;;&quot; missing after &quot;node * record)&quot;in cList</p>
  <p>Expecting &quot;)&quot; after node in &quot;void iIOrder(node * new node&quot;</p>
  </blockquote>