I have three if loops and I know when I run the program only one of them should be true and execute but when I do run, it always gives me a segmentation overflow, I'm not sure where its trying to access memory beyond its capabilites.
I can run my program in 3 different ways, the params that the 2nd and 3rd loop run fine. It is when I add the generic run method which it runs the program argv[0] and extra file param argv[1]. I know that the argc would equate to 2, but for some reason I get an error for that. Can anyone help?Code:if(argc == 2) { printf("enterd loop 1st loop\n"); } if(argv[2][0] == '-' && argv[2][1] == 'v' && argc == 7) { printf("enterd loop 2nd loop\n"); } if(argv[2][0] == '-' && argv[2][1] == 'v' && argc < 7) { printf("enterd loop 3rd loop\n"); exit(-1); }