Question
Write a C/C++ program (call it string invert) that takes a string argument from the command line and outputs the string in reversed order. You
Write a C/C++ program (call it string invert)
that takes a string argument from the command line and outputs the string in reversed order.
You have two constraints:
Constraint 1:
Each process can output at most one character. If you want to output more than a single character, you must fork off one or more processes in order to do that, and each of the forked processes in turn outputs a single character.
Constraint 2:
Each process can fork-off at most one other process. After the call to program string invert with the command line argument, the output should appear, and no more processes should be running, in addition to the shell.
(The source code should be at most a few lines long.)
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