Question: write a program in C to read a file., and fill in the below mentioned arrays. Input file is in the below format. player1,Center|88in,75kg|8,6,0,0,5,4|5,3,0,3,1,3 player2,Guard|183cm,170lbs|12,8,3,0,2,0|1,5,1,0,1,2

write a program in C to read a file., and fill in the below mentioned arrays.

write a program in C to read a file., and fill in

the below mentioned arrays. Input file is in the below format. player1,Center|88in,75kg|8,6,0,0,5,4|5,3,0,3,1,3

Input file is in the below format.

player1,Center|88in,75kg|8,6,0,0,5,4|5,3,0,3,1,3 player2,Guard|183cm,170lbs|12,8,3,0,2,0|1,5,1,0,1,2 player3,Forward|178cm,76kg,12,6,0,0,4,1|3,32,1,0,4

int g_player_count; char g_player_name[MAX_PLAYERS][NUM_ATTR] [MAX_NAME_LEN]; int g_attributes[MAX_PLAYERS][NUM_ATTR]; int g_shooting[MAX_PLAYERS] [NUM_COLS]; in't g_statistics[MAX_PLAYERS][NUM_COLS]; This function will open the file specified by the first argument and read in the records, filling the g-player_name, g_attributes, g_shootings and g_statistics arrays. From the input file, the height of a player can be given in inches or in centimeters, and the weight of a player can be given in kilograms or lbs. You need to convert them into the nearest inch and pound, respectively. Thinfunction should return the total number of players read and set g_player_count to be the number of players read in from the file (even if an error occurred). If any errors occur, you

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!