Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started