[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Arguments question
- Subject: [ale] Arguments question
- From: ChrisF at computone.com (Chris Fowler)
- Date: Wed, 2 May 2001 14:36:53 -0400
I would like to take simple programs and rename the main() function to the name of the simple program.?? I would then like to be able
to call them from one main program.?? Below is an example:
int
main(int argc, char argv[])
{
?????????????? if (strncmp(argv[0],"shell") == 0)
?????????????? ?????????????? shell(argv);
?????????????? return 0;
}
int
shell(int argc, char *argv[])
{
?????????????? /*
?????????????? ?????????????? Shell Code
?????????????? */
}
It seems simple, but my program that I am calling from main are not getting all the arguments.?? Maybe I've overlooked something.
Chris