tmadhavi17
Programmer
Hi there!
I am new to c language and especially in dealing with command line arguments. I came across a program which takes a dir name as argument. I got a doubt at the point where they were doing some validation like this and was quite puzzled of why they compared it so..
if (! strcmp(argv[1],"/?"){
printf("\nUsage:\>directory for xxx - Alpha Numeric, 8 or less chars)\n\n"
exit(0);
}
If I have to do it, I thought that I will check if "argc>1" or not (ofcourse, they did this too).
Any ideas what does comparing argv with "?" does mean??
cheers
-M
I am new to c language and especially in dealing with command line arguments. I came across a program which takes a dir name as argument. I got a doubt at the point where they were doing some validation like this and was quite puzzled of why they compared it so..
if (! strcmp(argv[1],"/?"){
printf("\nUsage:\>directory for xxx - Alpha Numeric, 8 or less chars)\n\n"
exit(0);
}
If I have to do it, I thought that I will check if "argc>1" or not (ofcourse, they did this too).
Any ideas what does comparing argv with "?" does mean??
cheers
-M