Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me change fgetc to fgets !!!! and explain a little bit please #include #include void printFileContents(char *fileName) FILE *fptr = fopen(fileName, r); if

Please help me change fgetc to fgets !!!! and explain a little bit please

image text in transcribed

#include #include void printFileContents(char *fileName) FILE *fptr = fopen(fileName, "r"); if (fptr NULL) printf("Cannot open file %s ", fileName); return /l Read contents from file char by char, and print char c - fgetc(fptr); while (c!- EOF) printf ("%C", c); c fgetc(fptr); int main(int argc, char *argv[l) // there are (argc-1) params of files, we can read and print int I for(i-1; ikargc; i+) printf(" Processing File %s ", argv[i]); printFileContents(argvli])

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

Concepts Of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

4th Edition

0619064625, 978-0619064624

More Books

Students also viewed these Databases questions

Question

5 2

Answered: 1 week ago