From 1d943da0cf9154e7ce78ce867cdbb91531c5d78e Mon Sep 17 00:00:00 2001 From: Matthew Sotoudeh Date: Tue, 25 Jul 2023 14:58:33 -0700 Subject: initial dietc commit --- tests/array_of_structs.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/array_of_structs.c (limited to 'tests/array_of_structs.c') diff --git a/tests/array_of_structs.c b/tests/array_of_structs.c new file mode 100644 index 0000000..0ab53b9 --- /dev/null +++ b/tests/array_of_structs.c @@ -0,0 +1,23 @@ +struct option { + char *name; + int has_arg; + int *flag; + int val; +}; + +static struct option const options[] = { + {"whatisup", 1, 0, 0}, + {"helloworld", 2, 0, 0}, + {"version", 3, 0, 0}, + {"help", 4, 0, 0}, + {"etc", 5, 0, 0}, + {0, 0, 0, 0}, +}; + +void puts(char *x); + +int main() { + for (struct option *opt = options; opt->name; opt++) { + puts(opt->name); + } +} -- cgit v1.2.3