-3

I am interested in writing a program in C or Python and add information to my software just like in command line, maybe I'm not explaining so good but what I want looks like this:

Ex: myProgram -u "Hello World"

Then after pressing enter to show my message on screen

1 Answers1

0

In c, we can receive "arguments" from the operating system in the following manner:

int main(int argc,char **argv){
    printf("Quantity of arguments: %i\n",argc);
    for(int i=0;i<argc;++i){
        printf("Argument %i: %s\n",i,argv[i]);
    }
}
Patrick Sturm
  • 393
  • 1
  • 13