Q6 Complete the process_file() function that takes 2 parameters: The process_file() function reads the contents of the t
Posted: Tue May 24, 2022 8:32 am
Q6
Complete the process_file() function that takes 2
parameters:
The process_file() function reads the contents of the
text file specified by filename. This file consists of 1 or
more lines of text, where each line of text is a single word. The
function stores these words in the words array. You can
assume that there will be at most 20 words in the text file. You
can also assume that the words will be no longer than 14 characters
in length. The process_file() function returns the number
of words read from the text file - an integer value.
Some examples of the function being called are shown below.
For example:
code:
int process_file(char* filename, char words[20][15]){
}
Complete the process_file() function that takes 2
parameters:
The process_file() function reads the contents of the
text file specified by filename. This file consists of 1 or
more lines of text, where each line of text is a single word. The
function stores these words in the words array. You can
assume that there will be at most 20 words in the text file. You
can also assume that the words will be no longer than 14 characters
in length. The process_file() function returns the number
of words read from the text file - an integer value.
Some examples of the function being called are shown below.
For example:
code:
int process_file(char* filename, char words[20][15]){
}