What is the meaning of the first line in the function secret? What is the output of return secret(3,argv)?
#include <stdio.h>
int secret(int argc, char **argv)
{
*argv && secret(0, argv + 1) &&
argc == 0 && printf("%s\n", *argv);
return argc == 0;
}
int main()
{
char *argv[] = {"hello", "XYZ", "123", "ABC", NULL};
return (secret(3,argv));
}
>Solution :
This
*argv && secret(0, argv + 1) &&
argc == 0 && printf("%s\n", *argv);
is a tricky (and harder to read, I think) way to write
if ( *argv && secret(0, argv + 1) && argc == 0 ) {
printf("%s\n", *argv);
}