Bye Bye Moore

PoCソルジャーな零細事業主が作業メモを残すブログ

2019-01-09から1日間の記事一覧

getopt関数のつかいかた

C

実際のところ #include <unistd.h> #include <stdlib.h> #include <stdio.h> int main(int argc, char *argv[]) { int flags, opt; int nsecs, tfnd; nsecs = 0; tfnd = 0; flags = 0; /* ":" は引数必須のオプション*/ while ((opt = getopt(argc, argv, "nt:")) != -1) { switch (opt) {</stdio.h></stdlib.h></unistd.h>…