main(int argc,char *argv[])
{
......;
......;
}
main(int argc, int*argv[])
{
......;
......;
}
#include <stdio.h>
int main(int argc, int*argv[])
{
int a=3;
int b=4;
printf("\n%s", (char*)argv[1]);
return 0;
}
Command Line arguments : abcd
Output : abcd
I have compiled the code above and worked perfectly. It seems that int* argv[]
is permitted. I think this is compiler specific some will allow it and other will not. You have to provide appropriate casting for the argument passed.