When i try to run this code:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]){
int i;
for(i = 0; i < argc; i++){
printf("argv[%d]: %s\n", i, argv[i]);
}
for(i = 1; i < argc; i++){
if(argv[i] == "-h"){
printf("You got helped\n");
}else{
printf("Failure!\n");
}
}
}
It always returns "Failure!". I tried to get it to return a help message aka "You got helped" when i run it with the "-h" flag, but it's not working. Any help?