title: Remove a data from a node
body: <pre><code>#include &lt;conio.h&gt;
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  class MysticalBag
  {
  private:
      int useCount;
      int content;
      string itemName;
  
  public:
  
      MysticalBag *next_ptr;
  
      void setAttributes()
      {
          //Called for showing the items without any placement of item
          useCount = 1;
          content = 5;
          itemName = "Healing Potion";
      }
  
      int takeUseCount()
      {
          return useCount;
      }
  
      int takeContent()
      {
          return content;
      }
  
      string takeItemName()
      {
          return itemName;
      }
  
      void setAttributes(int userCount, int content, string itemName)
      {
          this-&gt;useCount = useCount;
          this-&gt;content = content;
          this-&gt;itemName = itemName;
      }
  
      void itemAdder()
      {
          cout &lt;&lt; "Enter use count (1-3) " &lt;&lt;endl;
          cin &gt;&gt; useCount;
          cout &lt;&lt; "Enter content (1.0 - 100.0) " &lt;&lt;endl;
          cin &gt;&gt; content;
          cout &lt;&lt; "Enter item name as text" &lt;&lt; endl;
          cin &gt;&gt; itemName;
          cout&lt;&lt; itemName &lt;&lt;" is added in the bag."&lt;&lt; endl;
      }
  
      void showBag()
      {
          cout &lt;&lt; "Showing bag contents" &lt;&lt; endl &lt;&lt; endl;
          cout &lt;&lt; itemName &lt;&lt; endl;
          cout &lt;&lt; "U - "&lt;&lt; useCount &lt;&lt;", C - "&lt;&lt; content &lt;&lt; endl;
      }
  };
  
  
  
  int main()
  {
      char choice1,choice2;
      choice1 = 0;
  
      MysticalBag *head, *tail, *navigator;
  
      navigator = new MysticalBag();
      navigator-&gt;setAttributes();
      head = navigator;
      tail = navigator;
  
      tail-&gt;next_ptr = NULL;
  
      while(choice1 !='x')
      {
          cout &lt;&lt; "What do you want to do with the bag?" &lt;&lt; endl;
          cout &lt;&lt; "(a)dd item" &lt;&lt; endl;
          cout &lt;&lt; "(r)emove item" &lt;&lt; endl;
          cout &lt;&lt; "(s)how items" &lt;&lt;endl;
          cout &lt;&lt; "e(x)it" &lt;&lt;endl;
          cin &gt;&gt; choice1;
  
          if(choice1 == 'a')
          {
              navigator = new MysticalBag();
              if(head==NULL)
              {
  
                  head=navigator;
  
                  tail=navigator;
  
                  tail-&gt;next_ptr=NULL;
              }
  
              navigator-&gt;itemAdder();
              tail-&gt;next_ptr = navigator;
              tail = navigator;
              tail-&gt;next_ptr = NULL;
          }
  
          else if(choice1 == 'r')
          {
              navigator = head;
              tail = head;
  
              while(navigator-&gt;next_ptr != NULL)
                  {
                      navigator = navigator-&gt;next_ptr;
                      tail = navigator;
                  }
  
              cout &lt;&lt; "Do you want to remove "&lt;&lt; navigator-&gt;takeItemName() &lt;&lt;" from your bag? (y/n)"&lt;&lt; endl;
              cin &gt;&gt; choice2;
  
              if(choice2 == 'y')
              {
                  navigator = head;
                  if(navigator == head)
  
                  //I am stuck at this point!
  
                  navigator = NULL;
  
              cout &lt;&lt; "Item removed." &lt;&lt; endl;
  
              tail = head;
  
              while(tail-&gt;next_ptr != NULL)
                  {
                      tail = tail-&gt;next_ptr;
                  }
              }
              else
              {
                  cout&lt;&lt; "No item removed" &lt;&lt;endl;
              }
  
              navigator = head;
  
              if(navigator == head &amp;&amp; navigator == tail)
              {
                  navigator = NULL;
                  head = NULL;
                  tail = NULL;
              }
              else
              {
                  navigator = tail;
                  navigator = NULL;
                  tail = NULL;
  
                  tail = head;
  
                  while(tail-&gt;next_ptr != NULL)
                  {
                      tail = tail-&gt;next_ptr;
                  }
              }
          }
  
          else if(choice1 != 'x')
          {
              navigator = head;
              while(navigator != NULL)
              {
                  navigator-&gt;showBag();
                  navigator = navigator-&gt;next_ptr;
              }
          }
      }
      getch();
  }
  </code></pre>
  
  <p>My objective is removing data from a node.
  the user can put in data in the node, which is the Navigator.</p>
  
  <p>What I am thinking of is to point navigator to head and Making head recalling the setAttributes(). Which will show the "Healing potion". But, if the user adds to items. How would I remove just one item at a time?</p>