(Solved) : Far Void Getints Char Argv Unsigned Int Inputone Unsigned Int Inputtwo Unsigned Long Int O Q43922036 . . .
Here is what I have sofar:
void get_ints(char** argv,unsigned int* input_one,unsigned int* input_two,
unsigned longint* output, int num_ints)
{
int i =0;
FILE* file1 = fopen(argv[1], “r”);
FILE* file2 = fopen(argv[2], “r”);
if (file1 == NULL || file2 ==NULL) {
exit(EXIT_FAILURE);
}
fscanf(file1, “%dn”, &input_one[i]);
fscanf(file2, “%dn”, &input_two[i]);
fclose(file1);
fclose(file2);
}
Please try to implement this function using fgets()instead of fscanf(). Since the largest number is4294967295, we need 12 characters (including the null character andnew line) to read a number from the file
/* 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 int num_ints return parameters: none */ void get_ints (char** argv, unsigned int* input_one, unsigned int* input_two, unsigned long int* output, int num_ints) Show transcribed image text /* 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 int num_ints return parameters: none */ void get_ints (char** argv, unsigned int* input_one, unsigned int* input_two, unsigned long int* output, int num_ints)
Expert Answer
Answer to Here is what I have so far: void get_ints(char** argv, unsigned int* input_one, unsigned int* input_two, unsigned long i…
OR