c++_work

        while((ch=getopt(argc, argv, "X:Y:C:")) != EOF) 
        { 
                switch((char)ch) 
                { 
                        case 'X': 
                        strcpy(strSection, optarg); 
                        break; 
                        case 'Y': 
                        strcpy(strInstId, optarg); 
                        break; 
                        case 'C': 
                        strcpy(strSysId, optarg);//LogFile Name 会用 ELR,ELRQ,ELRC,ELR2 
                    break; 
                        exit(O); 
                } 
        } // Check the input parameter does exist or not
原文地址:https://www.cnblogs.com/ingstyle/p/10237323.html