[Solved] How is this program running in debug mode? [closed]


The source is in hw.cpp, which obviously is using some kind of argument parsing to look for ‘debug’.

For example:

#include <stdio.h>
#include <string.h>

int main(int argc, char *argv[])
{
  if (argc > 1 && strcmp(argv[1], "debug") == 0)
    printf("Hello World\n");

  return 0;
}

If you would like to do argument parsing more involved then this I suggest you look to getopt

8

solved How is this program running in debug mode? [closed]