Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

// copy.c //copy file f1 to f2 using standard I/O #include int copyfile(const char *f1, const char *f2) { FILE *inf, *outf; int c; if

image text in transcribed

// copy.c

//copy file f1 to f2 using standard I/O #include int copyfile(const char *f1, const char *f2) { FILE *inf, *outf; int c; if ((inf = fopen(f1,"r")) == NULL) { return (-1); } if ((outf = fopen(f2, "w")) == NULL) { fclose(inf); return (-2); } while ((c=getc(inf)) != EOF) { putc(c, outf); } fclose(inf); fclose(outf); return (0); } int main(int argc, char * argv[]) { copyfile(argv[1], argv[2]); }
Using OxceRUE (attached with the assignment) you will create a similar c program named SQRXXXAS. (copy with no comments) that will copy the file with no comments. It will remove any C file comment that follow // or in between of /* and */ For example, if we have file as with the following content: // This is a C program The program is created by Abed Alkhateeb It is jus an example: Created Date Jan 29 #include int main() { aciotti Hello World"); //print hello world message return } if you run_sar was. Sus Bus then Bus will have the following content: #include int main() { Rriathl"Hello World"); return 0; Using OxceRUE (attached with the assignment) you will create a similar c program named SQRXXXAS. (copy with no comments) that will copy the file with no comments. It will remove any C file comment that follow // or in between of /* and */ For example, if we have file as with the following content: // This is a C program The program is created by Abed Alkhateeb It is jus an example: Created Date Jan 29 #include int main() { aciotti Hello World"); //print hello world message return } if you run_sar was. Sus Bus then Bus will have the following content: #include int main() { Rriathl"Hello World"); 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

Filing And Computer Database Projects

Authors: Jeffrey Stewart

2nd Edition

007822781X, 9780078227813

Students also viewed these Databases questions

Question

How do modern Dashboards differ from earlier implementations?

Answered: 1 week ago