Various compilers allow you to abuse this function, but if you are going to follow the standatds, it expects to return an integer and receive two parameters. Consider the following example.
#include <stdio.h>
int main(
int argc, /* I. number of arguments. */
char *argv[]) /* I. Arguments as character strings. */
{
int i;
printf("Number of Arguments = %d\n", argc);
for (i=0; i<argc; i++)
{
printf("argument %d is %s\n", i, argv[i]);
}
exit(0);
}
|
example
program.
malloc function.
| Top | Master Index | Keywords | Functions |