void addTailInt (nodeType *first, int num)
{
nodeType *temp, *temp2;
temp = new nodeType;
cout<<"Please enter integer to be added onto the end of the list: "<<endl;
cin>>temp->num;
temp->next=NULL;
if (first==NULL)
{
first = temp;
}
else
{
temp2 = temp;
while (temp2->next != NULL)
temp2 = temp2->next;
temp2->next = temp;
}
cout<<endl;
}
void printListOne (nodeType *first,int num)
{
nodeType *current;
current = first; //points to first node
cout<<"List of numbers: ";
while (current!=NULL) //loop to print numbers after the first node
{
cout<<current->info<<", ";
current=current->link;
}
}
void sort(nodeType *first, int num)
{
cout<<endl;
nodeType *temp1; // creates a temporary node
temp1 = (nodeType*)malloc(sizeof(nodeType)); // allocates space for node
nodeType *temp2; // creates a temporary node
temp2 = (nodeType*)malloc(sizeof(nodeType)); // allocates space for node
Where are you stuck? What is not working right?
Please describe the problem(s) in more detail.
Few will examine the code to figure it out with nothing else to go on.