From a741d19b0c270add517997c8b724e07c50d1f2a3 Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Sat, 7 Sep 2019 18:27:14 -0400 Subject: finished basic returning --- out.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'out.c') diff --git a/out.c b/out.c index 720322c..cd8f28b 100644 --- a/out.c +++ b/out.c @@ -2,14 +2,21 @@ /* toc */ #include -void foo(int64_t (*out__)[3]) { - int64_t x[3] = {0}; - *out__ = x; - return; +void foo(int64_t (*out__)[3][3]) { + int64_t av___0[3][3] = {{0}}; + int64_t (*x)[3] = av___0; + memcpy(*out__, x, 9 * sizeof(int64_t )); return; } void main__(void) { - int64_t x[3] = foo(); - printf("Foo: %ld\n", (long)x); + int64_t av___1[3][3]; + foo(&av___1); + int64_t (*x)[3] = av___1; + +for (int i = 0; i < 3; i++) + for (int j = 0; j < 3; j++) + printf("%ld", x[i][j]); +puts(""); + ; return; } -- cgit v1.2.3