Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I/O redirection program for C Write a program in direct1.c which reads from standard input a line and then outputs that line immediately to standard

I/O redirection program for C

Write a program in direct1.c which reads from standard input a line and then outputs that line immediately to standard output. it should read entire line (not character only)

Then, write another program called direct2.c which reads from standard input every line until end of input and outputs them to standard output. Everything that goes in should come out exactly as it was.

Compile both programs and run them on the input files given below

The direct1 program should be run, redirecting input1.txt to standard input and redirecting output to output1.txt.

The direct2 program should be run, redirecting input2.txt to standard input and redirecting output to output2.txt.

Please write two programs direct1.c and direct2.c

Contents of Input1.txt Hi Hi Hi hi \

Hello Hello Hello Hello

Contents of Input2.txt

The quick brown fox jumps over the lazy dog

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

Database Processing

Authors: David Kroenke

11th Edition

0132302675, 9780132302678

More Books

Students also viewed these Databases questions

Question

To what microcultural groups do you belong?

Answered: 1 week ago