Correct the following program and explain why it still prints a line of foo after invoking the remove function. #include #include int main(void) { char buf[80]; FILE *fp = fopen(“foo”, ‘r’);...


Correct the following program and explain why it still prints a line of foo after invoking the


remove function.


#include


#include


int main(void)


{


char buf[80];


FILE *fp = fopen(“foo”, ‘r’);


remove(“foo”);


fgets(fp, buf, 80);


fprintf(“%s\n”, buf, stdout);


return 0;


}



May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here