Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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
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