From 9bffdf20775fe503917f8af186311dfb1cdf490a Mon Sep 17 00:00:00 2001 From: anon Date: Sun, 10 Mar 2024 15:57:35 +0100 Subject: [PATCH] Added getopt_test.c --- getopt_test.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 getopt_test.c diff --git a/getopt_test.c b/getopt_test.c new file mode 100644 index 0000000..368be7c --- /dev/null +++ b/getopt_test.c @@ -0,0 +1,16 @@ +#include +#include + +int main(int argc, char* argv[]) { + int opt; + + while ((opt = getopt(argc, argv, ";-a:")) != -1) { + switch (opt) { + default: + printf("%c", opt); + break; + } + } + + return 0; +}