Found another problem, though not related to files, might as well not make another thread.
This function:
Code:
void inputloop(Tree T){
int x=1;
int num;
char choice;
while(x==1){
printf("Enter (i)nsert, (s)earch, inorder (t)raversal, or (q)uit: ");
choice=getchar();
switch(choice){
case 'i':
printf("Enter a number to insert: ");
scanf("%d",&num);
T = Insert(num, T);
break;
case 's':
printf("Enter a number to search for: ");
scanf("%d",&num);
if(Find(num, T)==NULL) printf("%d is not in the tree.\n",num);
else printf("%d is in the tree.\n",num);
break;
default:
break;
}
}
}
Which handles user input for some reason it is printing Enter (i)nsert, (s)earch, inorder (t)raversal, or (q)uit: twice.
For example, this is what a run looks like:
Enter (i)nsert, (s)earch, inorder (t)raversal, or (q)uit: i
Enter a number to insert: 4
Enter (i)nsert, (s)earch, inorder (t)raversal, or (q)uit: Enter (i)nsert, (s)earch, inorder (t)raversal, or (q)uit:
No idea in hell why it is printing twice, probably something really easy as well.