diff options
| author | Teddy <ted.sybil@gmail.com> | 2014-05-07 11:55:51 +0800 |
|---|---|---|
| committer | Teddy <ted.sybil@gmail.com> | 2014-05-07 11:55:51 +0800 |
| commit | 30ecc9941b8da7a3c0108bc6117a1434e9caab94 (patch) | |
| tree | 6a24b25086c63a4aa112fc6173b29c31793099d8 /testbed/custom_struct2.c | |
| parent | bbb4de0693ba2b010cd2c44805d9a4ee4a2a8904 (diff) | |
| parent | 52b29440f8f1310e0c074c8eb409e433c56bdd62 (diff) | |
Merge /home/ymf/work/cibic into optimization
Diffstat (limited to 'testbed/custom_struct2.c')
| -rw-r--r-- | testbed/custom_struct2.c | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/testbed/custom_struct2.c b/testbed/custom_struct2.c deleted file mode 100644 index e147186..0000000 --- a/testbed/custom_struct2.c +++ /dev/null @@ -1,41 +0,0 @@ -struct A {
- int x, y;
-} sa;
-struct A print(struct A a, struct A b) {
- a.x++;
- a.y++;
- b.x--;
- b.y--;
- printf("args: %d %d\n", a.x, a.y);
- printf("args: %d %d\n", b.x, b.y);
- return a;
-}
-int main() {
- int i;
- int t;
- int *a, *b;
- struct A sb, sc;
- a = malloc(sizeof(int) * 100);
- for (i = 0; i < 100; i++)
- a[i] = i;
- b = malloc(sizeof(int) * 100);
- memcpy(b, a, sizeof(int) * 100);
- for (i = 0; i < 100; i++)
- printf("%d ", b[i]);
- sb.x = 1;
- sb.y = 2;
- sa = sb;
- sc = sa;
- printf("\n%d %d\n", sa.x, sa.y);
- printf("%d %d\n", sc.x, sc.y);
- sa.x = 1;
- sa.y = 2;
- sb.x = 1;
- sb.y = 2;
- sa = print(sa, sb);
- sb = print(sa, sb);
- sa = print(sa, sb);
- sb = print(sa, sb);
- printf("%d %d\n", sa.x, sa.y);
- printf("%d %d\n", sb.x, sb.y);
-}
|