@thebesthere231, make the changes suggested by @stahta01 and the changes I previously mentioned. Then also change the code in buildTree to
Code:
do {
character = getchar();
if(character == EOF) {
if (pointNode)
pointNode->count++;
return;
}
character = tolower(character); //Turns a big letter into a small letter lib <ctype.h>
/* ... rest remains the same as before ... */
and in main make this change
Code:
int biggestWordLength=bigWordLength(head, 0) + 1;
I don't know if the logic is correct, but it produces the output I expect
Code:
==4389== Command: ./test r
==4389==
world 1
hello 1
==4389==
==4389== HEAP SUMMARY:
==4389== in use at exit: 0 bytes in 0 blocks
==4389== total heap usage: 16 allocs, 16 frees, 80,846 bytes allocated
==4389==
==4389== All heap blocks were freed -- no leaks are possible
==4389==
==4389== For lists of detected and suppressed errors, rerun with: -s
==4389== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Now for some sleep :/