I'm very new, not exactly sure what i'm doing, it compiles but crashes when I input the file name, before i changed it to this it wasnt printing out the contents of the file
while (current != NULL)
{
printOne ( current->info) ;
cout << endl;
current = current->link;
}
}
inFile.close () ;
}
// inputs employee data from the inFile
// inserts the employeeType structs into a linked list
// in the same order as the input
// returns a pointer to the first node in the list.
nodeType * makeIt (ifstream& inFile)
{
nodeType * species, *last, *temp;
infoType x;
species = NULL;
x = getOne (inFile ) ;
while (inFile)
{
temp = new nodeType;
temp->info = x;
temp->link = NULL;
if ( species == NULL )
{
species = temp;
last = temp;
}
else
{
last->link = temp;
last = temp;
}
x = getOne (inFile ) ;
}
return species ;
}
void print(nodeType *species)
/* print displays the members of each element of the
linked list of structures of type nodeType; the formal parameter
first points to the first node in the list.