It is one of pset2 youtube video instruction about command-line argument. address is following, https://youtu.be/X8PmYwnbLKM
In 6:56, it shows code like this.
int main(int argc, char*argv[]) {
for(int i=0; i<argc; i++)
for(int j=0, n=strlen(argv[i]); j<n; j++)
printf("argv[%d][%d] is %c\n",i,j, argv[i][j]);
return 0;
}
This code works just fine and it makes me more curious. He didn't declare variable for n and he just used like n=strlen(argv[i]); how can it possible?
doesn't it have to be int n=strlen(argv[i])??
Thank you