Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Define Management or What is Management?

Answered: 1 week ago

Question

What do you understand by MBO?

Answered: 1 week ago

Question

What is meant by planning or define planning?

Answered: 1 week ago