Write a program, invoked with command-line parameters, which reads a file (whose path is specified as the last of 3 command-line parameters), searches for each occurrence of the string given as the first parameter and replaces it with the string given as the second parameter. The program is thus invoked by:
repa11 <string1> <string2> <file>
i.e." replace all occurrences of string 1 by string 2 in file" If spaces or other" white space characters are included in either string is to be delimited by double quotation marks.
I know how to do command-line parameters by ANSI-stardard C.
But i donot know what it means?
The command line args are argc and *argv. They work like this:
argc is the # of args
*argv is the array of strings
>But i donot know what it means?
You open the file
You read each line
If the line contains string1 then you replace it with string2
fopen / fclose / fgets / fputs - reading and writing files
strcpy, strcat, strstr - string handling