Question: Write a program in C that does the following: 1. It doesn't use a call from any C or C++ library including cout, cin, printf,

Write a program in C that does the following:

1. It doesn't use a call from any C or C++ library including cout, cin, printf, scanf, etc. Instead, it uses system calls such as open(), close(), read(), write(), and lseek().

2. It takes a file as input. It then reads the file from top to bottom and bottom to top simultaneously.

3. If a character being read in the first part is the same as a character being read in the second part, a 0 is printed out. Else, a 1 is printed out.

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!