I need help with a program that is supposed to take data on football players from a txt file and place them in a binary search tree then use case statements to t osearch the tree inorder, preorder and postorder recursively

here's what i got so far

/* Bradley Koperski
   CIS 126
   Project 9
*/

/* This program reads football statistics of players on the Chicago Bears from a 
   text files and disblay the desired information via a numbered menu system. 
*/

#include<stdio.h>
#include<string.h>
# define TYPED_ALLOC(type) (type *)malloc(sizeof (type)
/* define player structure */
typedef struct player
{
char team[3];        
int number, passyards, rushyards, recpyards, passTD, rushTD, recpTD, receptions;
char fname[30]; 
char lname[30];
char pos[4];     
char wname[60];
} playerdata;

typedef struct tree_node_s
{
        char key;
        struct tree_node_s *leftptr, *rightptr;
} tree_node_t;


void *tree_insert(tree_node_t *rootp , char new_key);
void tree_inorder(tree_node_t *rootp);

int
main(void)
{
          FILE *fptr;
          tree_node_t *bstreep; /* Binary Search Tree */
          playerdata data_key;
          bstreep = NULL;
    
      if ((fptr = fopen("C:/Documents and Settings/Owner/Desktop/Jason/C programing/assignment6/assignment6data.txt", "r")) == NULL) 
     { printf("Error: the file cannot be opened\n");
     }
     else
     fscanf(fptr, "%s %s %s %s %s", &data_key.team, &data_key.number, 
     &data_key.fname, &data_key.lname);
      strcpy(data_key.wname, data_key.lname);
 strcat(data_key.wname, ", ");
 strcat(data_key.wname, data_key.fname);
 bstreep = tree_insert(bstreep, data_key.wname);
}          


/* Fill Search tree */
tree_node_t *treeinsert(tree_node_t *rootp, char new_key) 
 {
 if (rootp==NULL)
 {
  rootp = TYPED_ALLOC(tree_node_t);
  strcpy(rootp->key,new_key);
  rootp->leftp = NULL;
  rootp_>rightp = NULL
}

else if (new_key == rootp->key)
{
 }
 /* Insert in left subtree */
 else if (strcmp(new_key ,rootp->key))<0)                      
 {
   rootp->leftp = treeinsert(rootp->leftp, new_key);
} /* End Insert */

/* Insert in right subtree */
else
{   
 rootp->rightp = treeinsert(rootp->rightp, new_key);
} /* End Insert */

return (rootp);
}
/* End treeinsert */

i keep getting an error when calling the treeinsert function that says
51 C:\Documents and Settings\Owner\My Documents\BRADLEY\Programming C\Brad Project 9\Brad assign 9.c [Warning] passing arg 2 of `tree_insert' makes integer from pointer without a cast

which doesn't make sense because the function only uses characters

someone please help me out

Addressing the error only (there are other issues), you're passing wname, which is an array of char. The function expects only a single char, not an array of them.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.