Boy do I feel dumb... I just realized that I could simplify my code significantly by using fscanf:
void getData (BST_TREE *wordBST)
{
FILE *fp1;
char buf[BUFSIZ], *pBuf;
int...
Type: Posts; User: jeanermand
Boy do I feel dumb... I just realized that I could simplify my code significantly by using fscanf:
void getData (BST_TREE *wordBST)
{
FILE *fp1;
char buf[BUFSIZ], *pBuf;
int...
Yeah I've since edited it again. Each WORD struct pointer is supposed to be placed in a BST, this was simply for the purpose of properly handing the strings before placing them in the WORD struct:
...
I thought of that, but then I thought that having the newline character would simplify the condition when looking for the end of a word.
Anyway, I found my problem. Turns out those few extra spaces...
So I'm reading in words from a text file. I start off by reading each line into a buffer string and then set a for loop to look for a space character or the newline character (as such would indicate...