lets say we run it by typing ./hello -argument1 -argument2 -argument3. why does the comparison fail at the while conidition??Code:#include <stdio.h> int main(int argc, char* argv[]) { argc--; ++argv; if(*argv) { while(argv[0][0] == ‘-‘ && argv[1] && argv[2]) { } return 0; }
argv[1] is -argument2 and argv[2] is -argument2. going by precedence, we comparre argv[0][0] == ‘-‘ && argv[1] first and this fails why?