|
-
May 10th, 2002, 11:33 AM
#1
Thread Starter
Addicted Member
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.
C, C++ and none of that MCF crap either!
-
May 10th, 2002, 11:59 AM
#2
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().
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|