aboutsummaryrefslogtreecommitdiff
path: root/compile_data/custom_struct3.c
diff options
context:
space:
mode:
Diffstat (limited to 'compile_data/custom_struct3.c')
-rw-r--r--compile_data/custom_struct3.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/compile_data/custom_struct3.c b/compile_data/custom_struct3.c
new file mode 100644
index 0000000..d7060b3
--- /dev/null
+++ b/compile_data/custom_struct3.c
@@ -0,0 +1,15 @@
+struct A {
+ int x, y;
+} a[10];
+struct A f(struct A a) {
+ a.x++;
+ a.y++;
+ return a;
+}
+int main(){
+ int i;
+ for (i = 1; i < 10; i++)
+ a[i] = f(a[i - 1]);
+ for (i = 0; i < 10; i++)
+ printf("%d %d\n", a[i].x, a[i].y);
+}