title: Error 2440 cannot convert from 'int' to 'node'
body: <p>Ok, so I'm working on a school assignment. I found this program that I wanted to use as an example to help me understand how the linked list system works. This specific program is supposed to create a linked list, and then ask the user to input "points" as in, an x and y pair. It stores each "point" in a node in the list and then should be able to print them all out. When I try to compile it though, i get 2 errors where it tells me that i can't convert from 'int' to 'node' and i have no idea why it is saying that. It looks like the syntax is the same as in the book so I must just be missing a small detail.</p>
  
  <p>On a side note, this program is a random thing I found to use as an example, so if possible, could anyone fill me in on how to make it cout the x and y coords at the end there? It's written there in comments that it still needs to be done. </p>
  
  <p>Here's the full error message:(the errors occur on line 44 and 67, both the lines that say "newNode->info = input;" )</p>
  
  <p>Error   1   error C2440: '=' : cannot convert from 'int' to 'node *'    </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;list&gt;
  #include &lt;cassert&gt;
  #include &lt;ostream&gt;
  
  
  
  using namespace std;
  
  struct node
  {
  node *info;
  node *link;
  int x, y; 
  };
  
  node* getXandY();
  
  int main()
  {
  return 0;
  }//end main
  
  node* getXandY()
  {
  node *newNode, *first, *last; 
  
  int input;
  int count = 0;
  
  cout &lt;&lt; "Enter as many points as you like: (x,y)" &lt;&lt; endl;
  first = NULL;
  
  do 
  {
      //x integers
      cout &lt;&lt; "Enter an X value: ";
      cin &gt;&gt; input;//read info
      int x = input; //store info (x) into input
  
      newNode = new node();//allocate memory for the type node
      assert(newNode != NULL);//terminate program is no memory space
  
      newNode-&gt;info = input;//copy value into input
      newNode-&gt;link = NULL;
  
      if (first == NULL)
      {
          first = newNode;
          last = newNode;
      }
      else
      {
          last-&gt;link = newNode;
          last = newNode;
      }
  
  
      //y integers
      cout &lt;&lt; "Enter an Y value: ";
      cin &gt;&gt; input;//get info
      int y = input;//store in for (y) into input
  
      newNode = new node;//allocate memory for the type node
      assert(newNode != NULL);//terminate program is no memory space
  
      newNode-&gt;info = input;//copy value into input
      newNode-&gt;link = NULL;
  
      if (first == NULL)
      {
          first = newNode;
          last = newNode;
      }//end if
      else
      {
          last-&gt;link = newNode;
          last = newNode;
      }//end else 
  }//end do
  while (input != 999);
  
  
  for (int i = 0; i &lt; count; i++)
  {
      cout &lt;&lt; "("  /*place code here x value &lt;&lt;*/  "," &lt;&lt; /*place code here y value &lt;&lt;*/   ")" &lt;&lt;endl;    
  }//end for
  getchar(); 
  }
  </code></pre>