This is an amazing site for people who are interested in the c language andother wonderful languages too.
Please i have just started learning about the c language, being a novice i stumbled on this piece of work, and i was wondering if you great people can help me.I'm working on a unix system.
The program might be run as follows:
Command line with redirection
a.out "old" "new" <infile >outfile
Note that input is from stdin and output to stdout.(keyboard to screen)
The output should be the same as the input except that all
occurences of the string "old" are replaced by "new".
For example, if you run a.out lara D with input
I love lara
lara wakes me up
then the ouput would be
I love D
D wakes me up
Your program should work for any argument strings including
those that contain spaces. However, newline characters are
not allowed in the "old" or "new" strings. If they are found
print an appropriate usage message to stderr.
I'll appreciate any help sirs/ma's.