Trying to get a grounded list to print
<p>so i can get the read to work and it to print in the read by entering it there. Once I put it through to the transversal, wont print with or without the loop.  See anything I'm missing?</p>

<pre><code>#include&lt;iostream&gt;
#include&lt;fstream&gt;
#include&lt;iomanip&gt;
#include&lt;string&gt;
using namespace std;


struct listtype
{
  int id;
  string first;
  string last;
  string degree;
  int crhrs;
  double gpa;
  listtype *link;
};
void createm (listtype *&amp;head, listtype *&amp;tail)
{
  head = new listtype;
  tail= new listtype;
  head-&gt;id = 0;
  tail-&gt;id = 9999;
  head-&gt;link =tail;
  tail-&gt;link = NULL;
}
bool empty(listtype *head, listtype *tail) 
{
  return head-&gt;link == tail;
}

void readem(listtype *head, listtype *tail)
{
  int id;
  string first;
  string last;
  string degree;
  int crhrs;
  double gpa;
  listtype *link; 
  ifstream inf("project2.dat");
  while (!inf.eof())
  {
    inf&gt;&gt;id&gt;&gt;first&gt;&gt;last&gt;&gt;degree
      &gt;&gt;crhrs&gt;&gt;gpa;
    //insertem(head, tail, id,first,last,degree,crhrs,gpa);
  }
}
</code></pre>

<p>So here is where it wont print. I for the life of cannot see what I'm missing. I'm guessing I'm missing something from the read correct?</p>

<pre><code>void traverselist (listtype *head, listtype *tail, ofstream &amp;outf)
{
  listtype *c;
  c=head-&gt;link;
  if (!empty(head,tail))
    while (c!=tail)
      {
      cout&lt;&lt;c-&gt;id&lt;&lt;endl;//c-&gt;first&lt;&lt;c-&gt;last&lt;&lt;c-&gt;degree&lt;&lt;c-&gt;crhrs&lt;&lt;
                         c-&gt;gpa&lt;&lt;endl;
      c=c-&gt;link;
      }
  else
    cout&lt;&lt;"the list is empty"&lt;&lt;endl;
}


/*void insertem (listtype *head, listtype *tail, int id, string first,
      string last, string degree, int crhrs, double gpa)
{
  listtype *knew, *prior, *next;
  knew= new listtype;
  knew-&gt;id= id;
}*/
void main()
{
  listtype *head, *tail;
  ofstream outf("project2.out");
  outf.setf(ios::fixed);
  outf.precision(2);
  createm(head, tail);
  readem (head, tail);
  traverselist(head, tail, outf);

  system ("pause");
}
</code></pre>
