Hi, I can't get this piece of code to work. I need it to print any CLAs which start with a '-'
Would be great if you could help me out. Ta.
This is what i have so far:
Code:#include <stdio.h> #include <string.h> int main(int argc, char * argv[]) { FILE * output = stdout; FILE * input = stdin; int count=0; for(count=0;count<argc;count++) { if (strcmp(argv[count][0],"-")==0) { fprintf(output,"%s\n",argv[count]); } } }