ok...
i ran it like this:
swap(&start, &start->next, start);
Code:
void swap(charNode **a, charNode **b, charNode *start) {
charNode *temp;
charNode *preA = pred(start->next, start);
charNode *preB = pred(start, start);
preB = preA;
temp = *a;
*a = *b;
*b = temp;
}
and
Code:
charNode *pred(charNode *a, charNode *List)
{
if(a == List)
{
//printf ("BLAH");
return NULL;
}
if( a == (*List).next)
{
return List;
}
if((*List).next == NULL)
{
printf("Not in list.");
}
else
{
printf("RETURNED");
return pred(a,(*List).next);
}
}
it just returns
Androd
Bat
Dog is still missing...
original list:
Dog
Androd
Bat