Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLease help me complete this and compile in VM. Some reason the txt fle with the character is not reading while compiling. See the Iseek

PLease help me complete this and compile in VM. Some reason the txt fle with the character is not reading while compiling.

image text in transcribed

image text in transcribed

See the Iseek example.c file provided on Canvas under the code/syscalls files. Modify the Iseek_example.c, such that it reads from an input file (named "start.txt") and will print to an output file (named "end.txt") every (1+3*i)th character, starting from the 1st character in the input file. In other words, it will print the 1st character, then skip 2 characters and print the 4th one, then skip 2 characters and print the 7th one, and so on. For instance, for input file: ABCDEFGHIJKLM It will output: ADGJM You may use cLion inside VM, or any other text editor of your choice, such as vi or emacs. There is also a neat text editor named Kate available in Ubuntu (you can find it in the menu). In cLion you can open a single.c file without having to create a whole new project and modify the single.c file. Find the Iseek_example.c file and open it in the text editor tool you choose to use. In the command line terminal (Shell), you can compile with "gcc -o Iseek_example Iseek_example.c". This is going to create an executable file named "I seek_example". You can run it with "./Iseek_example". Submit the Iseek_example.c file (source code file) that you modified. // C program to read nth byte of a file and 11 copy it to another file using Iseek #include #include #include #include void func(char arr[], int n) { // Open the file for READ only. int f_read = open("start.txt", O_RDONLY); // Open the file for WRITE and READ only. int f_write = open("end.txt", O_WRONLY); int count = 0; while (read(f_read, arr, 1)) { // to write the 1st byte of the input file in // the output file if (count <>

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

Moving Objects Databases

Authors: Ralf Hartmut Güting, Markus Schneider

1st Edition

0120887991, 978-0120887996

More Books

Students also viewed these Databases questions

Question

What languages support negative subscripts?

Answered: 1 week ago