Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following UNIX C program is to merge the content of all txt files in the current directory into file merged.dat. #include void mergegile (char

image text in transcribed
The following UNIX C program is to merge the content of all txt files in the current directory into file merged.dat. #include void mergegile (char filename[], FILE *fp2); int main() {FILE -fp1, *fp2; char filename [100]; system ("ellipsis (1) ellipsis");/* store txt filenames into file filenames. Tmp*/fp1 = fopen ("filenames.tmp", "r"); fp2 = fopen("merged.day", "w"); while(fscan f(ellipsis (2) ellipsis) = = 1) mergefile (filename, fp2); fclose (fp1); fclose(fp2); remove("filenames.tmp"); return 0;} void mergefile (char filename [], FILE *fp2) {FILE *fp3; int ch; fp3 = fopen (filename, "r"); while ((ch = fgetc(fp3))! = EOF) ellipsis (3) ellipsis fclose(fp3);}

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

Students also viewed these Databases questions

Question

4. How was relationship satisfaction measured in these studies?

Answered: 1 week ago