Here is an example of how it is done:
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[])
{
for(int i = 0; i < argc; i++)
{
if(0 == i) printf("The Application Path is: %s\n",argv[i]);
if(0 == strcmp("/1",argv[i])) printf("Arg /1\n");
else if(0 == strcmp("/2",argv[i])) printf("Arg /2\n");
else if(0 == strcmp("/S",argv[i])) printf("The String is: %s\n", argv[++i]);
else printf("No valid arguments\n");
}
scanf();
return 0;
}
In the IDE you can enter command line arguments for debugging as follows:
Project>Project Options>General Tab>Command Line arguments:
I used the following to test this: /1 /S "Hello World" /2