2014年6月7日 星期六

[C] How to make parameter at C program


[C] How to make parameter at C program



#include <stdio.h>

#include <stdlib.h>



int

main(int argc, char *argv[])

{



    int ch;

    while ((ch = getopt(argc, argv, "c")) != EOF)

        switch(ch) {

        case 'c':

            printf("Happy  \n");

            break;

        default:

            exit(2);

        }

}



Reference:




  • Ping Source Code


0 意見:

張貼留言