Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write all answers using C and comment all lines: a) b) c) /* Since the largest number is 4294967295, we need 11 characters (including
Please write all answers using C and comment all lines:
a)
b)
c)
/* Since the largest number is 4294967295, we need 11 characters (including the null character) to read a number from the file */ #define MAX_NUM_LENGTH 11 /* This function takes in the two input file names (stored in argv) and determines the number of integers in each file. If the two files both have N integers, return N, otherwise return -1. If one or both of the files do not exist, it should exit with EXIT_FAILURE. input parameters: char** argv return parameters: -1 if the two input files have different number of integers N if the two input files both have N integers */ int get_num_ints(char** argv) /* This function allocates engough memory to the three arrays to store num_ints elements each. This function should exit with EXIT_FAILURE if the program fails to allocate. the memory. input parameters: unsigned int* input_one unsigned int* input_two unsigned long int* output int num_ints return parameters: none void allocate_mem(unsigned int** input_one, unsigned int** input_two, unsigned long int** output, int num_ints) wan /* This function reads in num_ints integers from the two input files and stores them in input_one(first input file) and input_two (second input file). If one or both of the files do not exist, it should exit with EXIT_FAILURE. input parameters: char** argv unsigned int* input_one unsigned int* input_two num_ints return parameters: int none void get_ints(char** argv, unsigned int* input_one, unsigned int* input_two, unsigned long int* output, int num_ints) wStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started