summaryrefslogtreecommitdiff
path: root/tests/array_of_structs.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/array_of_structs.c')
-rw-r--r--tests/array_of_structs.c23
1 files changed, 23 insertions, 0 deletions
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);
+ }
+}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback