title: invalid operands to binary expression ('ostream' (aka 'basic_ostream<char>') and 'void')
body: <p>I have homework for Data Structure in college with LinkedLists ,</p>
  
  <p>did the code but the compiler "eclips" shows me an error called 
  Description Resource    Path    Location    Type</p>
  
  <p>invalid operands to binary expression ('ostream' (aka 'basic_ostream') and 'void')    LinkedLists.cpp /LinkedLists/src    line 156    C/C++ Problem</p>
  
  <p>and this is the code , so what's this issue ? and how can i fix it?</p>
  
  <p>Thanks ^^</p>
  
  <pre><code>struct node {
      int StudentNumber;
      string name;
      node *link,*data;
  
      };
  
  node *head,*newNode,*last;
  string name;
  int StudentNumber;
  
  node* insert (){
              char a='n';
              cout&lt;&lt;"hello to linked lists insertion"&lt;&lt;endl;
  
              cout&lt;&lt;endl&lt;&lt;"please write your name : ";
              cin&gt;&gt;name;
              cout&lt;&lt;"please put the student number : ";
              cin&gt;&gt;StudentNumber;
              head=NULL;
  
              while(a!='n'||a!='N'){
  
                  newNode = new node ;
                  newNode-&gt;StudentNumber=StudentNumber;
                  newNode-&gt;name=name;
                  newNode-&gt;link=NULL;
  
                  if (head==NULL)
                  {
                      head=newNode;
                      last=newNode;
  
                  }else {
  
                      last-&gt;link=newNode;
                      last=newNode;
  
                  }//end else
  
  
                  cout&lt;&lt;"please write your name : ";
                  cin&gt;&gt;name;
                  cout&lt;&lt;endl&lt;&lt;"please put the student number : ";
                  cin&gt;&gt;StudentNumber;
                  cout&lt;&lt;"Do you want to insert new nodes ? y for yes , n for no ";
                  cin&gt;&gt;a;
  
  
              }//end while
  
              return head;
      }//end insert function
  
  
  // adding nodes function
  
  void add() {
      int j;
      cout&lt;&lt;"please choose your option for adding new node : 1 for add at the beginning , 2 for add at the end ";
      cin&gt;&gt;j;
      if (head!=NULL)
          {
      switch (j)
  {
      // adding at the beginning
  case 1 :
          newNode=new node;
          newNode-&gt;link=head;
          head=newNode;
          cout&lt;&lt;"please insert your node data : ";
          cout&lt;&lt;"Student Name : "&lt;&lt;newNode-&gt;data&lt;&lt;endl&lt;&lt;"and student number is : "&lt;&lt;newNode-&gt;StudentNumber;
  
      break;
      // at the end
  case 2:
      newNode= head;
      while (newNode-&gt;link!=NULL)
      {
          newNode = newNode-&gt;link;
  
      }// end of while
      last= newNode;
      newNode = new node ;
      newNode-&gt;link=NULL;
      last-&gt;link=newNode;
      cout&lt;&lt;"please insert your node data : ";
      cout&lt;&lt;"Student Name : "&lt;&lt;newNode-&gt;data&lt;&lt;endl&lt;&lt;"and student number is : "&lt;&lt;newNode-&gt;StudentNumber;
      break; // end of case adding at the end
  
  
  }
  }else {cout&lt;&lt;"The list is empty";}
  
  }// ending of the adding nodes function
  
  
  // delete node function
  
  void deletion () {
      int s;
      cout&lt;&lt;"please choose your option for deleting nodes : 1 for delete the first , 2 for delete the last node ";
              cin&gt;&gt;s;
  switch (s) {
  // delete the first node
  case 1 :
      newNode = head;
      last=head-&gt;link;
      head=last;
      delete newNode;
      break;
  
      //delete the last node
  case 2:
      newNode=head;
      last=head;
      while (newNode-&gt;link!=NULL)
      {
          last=newNode;
          newNode=newNode-&gt;link;
      }
      last-&gt;link=NULL;
      delete newNode;
      break;
  
  
  }//end of the switch
  
  
  }// end of delete nodes function
  
  
  
  
  int main() {
      int m;
      cout&lt;&lt;"Welcome to LinkedLists Example"&lt;&lt;endl;
      cout&lt;&lt;"enter your choice number , 1 for inserting nodes to the list , 2 for adding nodes , 3 for deleting nodes ";
      cin&gt;&gt;m;
      switch(m) {
      case 1:
          cout&lt;&lt;insert();
          break;
      case 2:
          cout&lt;&lt;add();
          break;
      case 3:
          cout&lt;&lt;deletion();
          break;
  
  
      }
  
  return 0;
  </code></pre>
  
  <p>}</p>