-
int argc, char *argv[]
I am trying to take paramiters from the command line but everytime i compile this it tells me
error C2061: syntax error : identifier 'argc'
I dont know if i need to be including a header to get the argc and argv thing to work but i searched around the forums and it looks like no one else is so i dont know. Thanks for any help.
-
Code:
#include <stdio.h>
int main(int argc,char *argv[]){
int i;
i=1;
while(i<=argc) printf("Parameter #%d %s\n",i,argv[i++]);
return 0;
}
You should not have to include anything, I included stdio.h because of printf().