Question: How can I fix this? /* This function initialises each field of one playet_t struct. Inputs: player_p - memory location of the player_t variable. player_p

How can I fix this?

/* This function initialises each field of one playet_t struct. Inputs: player_p - memory location of the player_t variable. player_p must have been allocated memory using allocate_memory before calling this function. nplayers - number of players that memory needs to be allocated for Post: After the function has been called, the age field of *player_p will be the input age, and wickets field of *player_p will be the input wickets. */

void init_player(player_t* player_p, int age, int wickets) { player_p = ( player_t * )malloc( sizeof(player_p) );

player_p->age = age;

player_p->wickets = wickets; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!