Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions