previous | start | next

Summary Example: Executing a Program with Command Line Arguments

A program printCh is to be executed like this if no command line arguments are given:

        $ printCh
        argc = 1
        argv[0] = printCh
        AAAAA
        AAAAA
     

But if a command line argument is typed:

        $ printCh B
        argc = 2
        argv[0] = printCh
        argv[1] = B
        BBBBB
        BBBBB
     


previous | start | next