title: Adding a new node to a list and dynamically naming it
body: <p>I have a few questions regarding lists. First, here is my code:</p>
  
  <pre><code>#include &lt;iomanip&gt;
  #include &lt;iostream&gt;
  #include &lt;cstdlib&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  struct node {
      int x;
      node *next;
  };
  
  void main()
  {
      node *root;
      node *curr;
  
      int exit = 0;
      string temp;
      root = new node;
      root-&gt;next = 0;
      curr = root;
      cout &lt;&lt; "Please enter the root number: ";
      cin &gt;&gt; root-&gt;x;
  
      for( int i=0; i&lt;10; i++)//Will promt user to enter numbers
      {
          cout &lt;&lt; "Enter string name for new node: ";
          cin &gt;&gt; temp;
      }
  
      if (curr != 0)//Used for traversing the LL and outputting
      {
          while (curr-&gt;next != 0)
          {
              cout &lt;&lt; curr-&gt;x;
              curr = curr-&gt;next;
          }
      }
  }
  </code></pre>
  
  <p>I would like the user to be prompted to enter a number in the for loop to be added on to the first node. But I am confused on creating more nodes past the root. Do they have to have different names for each node? I see where I created a new node named root. Would I have to do that for each and every node? If I do, can I have the user input a name for that node and have the program write in that name?</p>