title: assignment makes pointer from integer without a cast [enabled by default] in c language
body: <p>code:</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;stdlib.h&gt;
  struct node 
  {
      int data;
       struct node *next;
  };
  struct node *head,*temp;
  int insert_end(int);
  int insert_begin(int);
  int display(void);
  int delete_end(void);
  int delete_begin(void);
  
  int main()
  {
      head=(struct node *)malloc(sizeof(struct node));
      temp=(struct node *)malloc(sizeof(struct node));
      head-&gt;next = -1;
      int choice,a,b;
  label:
  printf("\n\t1.insert_end 2. insert_begin 3.\n delete_end 4.delete_begin   \n5.display 6.exit ");
  scanf( "%d",&amp;choice);
  switch ( choice )
  {
      case 1:
  {
      printf("\tenter the no to be insert at the end ");
      scanf("%d",&amp;a);
      insert_end (a);
  
      goto label;
  
  }
  case 2:
  printf("\tenter the no to be insert at the beginnig ");
  scanf("%d",&amp;a);
  insert_begin (a);
  
  goto label;
  
  case 3:
  {
      b = delete_end();
      if ( b == 0)
      {    
          printf( " \t\tfailed ! ! \n");}
          else 
          {
              printf( " \t\t success ! ! \n");}
  
           goto label;
  }
  
  case 4:
  {
      b = delete_begin();
      if ( b == 0)
      {
          printf( " \t\tfailed ! ! \n");}
      else 
      {
          printf( " \t\t success ! ! \n");}
  
          goto label;
      }
   case 5:
   {
       temp =head ;
       display();
       goto label;
   }
   case 6:
   {
       exit (0);
   }
  default: 
  {
      printf( "wrong options");
      goto label;
   }
  
  }
  }
  
  int insert_end ( int a )
  {
  temp = head;
  while (1)
  {
      if (temp-&gt;next == -1)
      {
          temp-&gt;data =a;
          temp-&gt;next =0;
          return 0;
      }
          else if (temp-&gt;next == 0)
          {
              temp-&gt;next = malloc(sizeof ( struct node));
              temp =temp-&gt;next;
              temp-&gt;data =a;
              temp-&gt;next =0;
              return 0;
          }
         else 
         {
             temp = temp-&gt;next;
         }
     }
  }
  
  
  int display()
  {
  temp=head;
  while (1)
  {
      if (head-&gt;next == -1)
      {
          printf( "\tEmpty ! ! !\t\n");
          break;
      }
      else  if ((head-&gt;next == 0) )
      {
          printf( " %d ", head-&gt;data);
          break;
       }
   else if (temp-&gt;next != 0 )
   {
       printf (" %d -&gt;", temp-&gt;data );
       temp =temp-&gt;next ;
   }
   else if (temp-&gt;next == 0 )
   {
       printf(" %d ", temp-&gt;data);
       return 0;
   }
  }
  }
  
  
  int insert_begin(int a)
  {
  if(head-&gt;next == -1)
  {
      head-&gt;data =a;
      head-&gt;next=0;
      return 1;
  }
  else 
  {
      temp =malloc(sizeof ( struct node ));
      temp-&gt;data =a;
      temp-&gt;next = head;
      head = temp;
      return 1;
   }
  }
  
  int delete_end (void)
  {
  temp=head;
  while (1)
  {
      if (head-&gt;next == -1)
      {
          return 0;
      }
      else if (head-&gt;next == 0)
      {
          head-&gt;next = -1;
          return 1;
      }
      else if (temp-&gt;next-&gt;next == 0)
      {
          temp-&gt;next =0;
          return 1;
      }
      else 
      temp=temp-&gt;next;
  }
  }
  
  
  int delete_begin(void)
  {
  if ( head-&gt;next == -1)
  {
       return 0;
  }
       else if ( head -&gt; next == 0)
       { 
            head-&gt;next = -1;
            return 1;
       }
       else 
       {
           head=head-&gt;next;
           return 1;
       }
  }
  
  error:
  
  linkedlist1.c: In function ‘main’:
  
  linkedlist1.c:19:12: warning: assignment makes pointer from integer without a cast [enabled by default]
  
  head-&gt;next = -1;
          ^
  linkedlist1.c: In function ‘insert_end’:
  
  linkedlist1.c:87:16: warning: comparison between pointer and integer [enabled by default]
  if (temp-&gt;next == -1)
              ^
  linkedlist1.c: In function ‘display’:
  
  linkedlist1.c:115:16: warning: comparison between pointer and integer [enabled by default]
  if (head-&gt;next == -1)
              ^
  linkedlist1.c: In function ‘insert_begin’:
  
  linkedlist1.c:141:15: warning: comparison between pointer and integer [enabled by default]
   if(head-&gt;next == -1)
             ^
  linkedlist1.c: In function ‘delete_end’:
  
   linkedlist1.c:162:16: warning: comparison between pointer and integer [enabled by default]
   if (head-&gt;next == -1)
              ^
  linkedlist1.c:168:12: warning: assignment makes pointer from integer without a cast [enabled by default]
   head-&gt;next = -1;
          ^
  linkedlist1.c: In function ‘delete_begin’:
  
  linkedlist1.c:184:17: warning: comparison between pointer and integer [enabled by default]
   if ( head-&gt;next == -1)
               ^
  linkedlist1.c:190:12: warning: assignment makes pointer from integer without a cast [enabled by default]
   head-&gt;next = -1;
          ^
  </code></pre>
  
  <p>When I try to compile with GCC, I end up with a warning that says " assignment makes pointer from integer without a cast [enabled by default] please help me resolve the above warnings. I don't know what the error is.</p>