Question: write program in C , follow all the instructions listed if you chose to answer . thank you the C programming language Given a file,

write program in C , follow all the instructions listed if you chose to answer . thank you write program in C , follow all the instructions listed if you
the C programming language

Given a file, "data.txt", uploaded into the assignment folder, create a program with the following functionality. You may use the program in p. 20 of the textbook as a starting template. 1) Use BUFSIZE=10 to iteratively read/write bytes from the input file. If you use other sizes of buffer array, you will get 0 point. 2) After your program's execution, the "data.txt" file contents should be reversed. For example, if the original contents of "data.txt is ABCDEFGHIJKLMN, then the new contents should be NMLKJIHGFEDCBA. The file size should remain the same. 3) You can't use any additional array or dynamic memory in your program except for buffer[10]. 4) You can't create/access any other files. 5) If you want, you may find out the size of the file before the main loop. But, this is not really needed. We learned how to get the size of the file by using Iseek() call. 6) You need to iterate the following 4 steps as was discussed in the class: a) Use Iseek() to move a read-write pointer towards the end of the file. b) Call read() to read 10 bytes into buffer[]. c) Reverse each byte in the buffer(). d) Again, use Iseek() to restore the read-write pointer to the position after a). e) Write buffer[] back to the file. 7) Print out the new contents of "data.txt" file at the end of your program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!