Question: Assuming that the disk file foobar.txt consists of the six ASCII characters foobar, what is the output of the following program? 1 #include csapp.h 2
Assuming that the disk file foobar.txt consists of the six ASCII characters foobar, what is the output of the following program?

1 #include "csapp.h" 2 3 4 5 6 7 8 9 10 11 12 13 14 15 int main() { } int fd1, fd2; char c; fd1 = Open ("foobar.txt", fd2 = Open ("foobar.txt", Read (fd2, &c, 1); Dup2 (fd2, fd1); Read (fd1, &c, 1); printf ("c %c ", c); exit(0); = O_RDONLY, 0); O_RDONLY, 0);
Step by Step Solution
3.40 Rating (156 Votes )
There are 3 Steps involved in it
At first glance you migh... View full answer
Get step-by-step solutions from verified subject matter experts
