阅读背景:

getopt如何设置默认值

来源:互联网 
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
#include <string.h>


int main(int argc, char **argv) {
    int o;
    int w = 10;

    while ((o = getopt(argc, argv, "w")) != -1) {
        switch (o) {
            case 'w' :
                w = atoi(optarg);
                break;



        }

    }
    printf("%d\n", w);
}
#include <stdio.h>
#include <stdlib.h>
#include



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: