Question: PLEASE HELP ASAP In c write the following function int line_length (char *filename, int n); the function should return the number of characters of line
PLEASE HELP ASAP In c write the following function int line_length (char *filename, int n);
the function should return the number of characters of line #n in the text file who's name is filename. same the max number of characters is 1000. if for doesn't exist return 0. you might bad the file reading function fgets.
int line_length (char *filename, int n) { char str [1001]; file* pfile; int count=0; if (pfile== NULL) {print("error"); return 0;
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
