void display(char * str){ printf(\"%s: Missing file\\n\", str); } int main(int argc, char **argv) { int longIndex, opt = 0; const char *optString = \"h?
If you include -? with --help on your help message, leave the question mark out of your call to getopt, leave it out of the case option, and make sure that --help is the first case option in your list, the question mark works as you'd want it to.