The purpose of the function is to print the number of vowels in a linked list. The function compiles fine but will not print the correct number. I am not sure what is wrong. Any help would be great.
Code:
#include "mystuff.h"
void vowels (NODE* pList)
{
char w;
char a;
char e;
char i;
char o;
char u;
char A;
char E;
char I;
char O;
char U;
int sum = 0;
NODE* pWalker;
pWalker = pList;
printf("c. The total number of vowels in the linked list is: ");
while (pWalker)
{
w = (pWalker->data.key);
if (w = a, e, i, o, u, A, E, I, O, U)
sum++;
pWalker = pWalker->link;
}
printf("%d", sum);
printf("\n");
return;
}