Hi there,
Im new to 'c' and i am trying to do a pass a command line option to my program but i cannot get it to work.
Here is my code ...
#include <stdio.h>
#include <stdlib.h>
main(argv,argc)
int argc;
char *argv[];
{
printf("\nYour input was %s\n\n",argv[1]);
printf("\n"
}
when i compile it i get ....
Segmentation fault (core dumped)
Where have i gone wrong? Can somebody point me in the right direction.
Thanks,
Jaybot :-(
"Always know what you say, but don't always say what you know!"
Im new to 'c' and i am trying to do a pass a command line option to my program but i cannot get it to work.
Here is my code ...
#include <stdio.h>
#include <stdlib.h>
main(argv,argc)
int argc;
char *argv[];
{
printf("\nYour input was %s\n\n",argv[1]);
printf("\n"
}
when i compile it i get ....
Segmentation fault (core dumped)
Where have i gone wrong? Can somebody point me in the right direction.
Thanks,
Jaybot :-(
"Always know what you say, but don't always say what you know!"