Possible Duplicate:
Pass arguments into C program from command line
I am trying to pass three arguments from terminal into a function called replace. I would like to know if it is possible to do the following from terminal
% ./replace d DDD mytest.tx
I have looked online but can only find information on passing values directly to main() and not the function inside.
Edit: I have edited the main functions as following:
void replace(char* string_a, char* string_b, char* string_f)
{
}
int main(int argc, char *argv[])
{
if(argc < 4)
{
printf("Not enough arguments\n");
return 0;
}
replace(argv[1],argv[2],argv[3]);
}