comparison python/c3/examples/types.c3 @ 237:81752b0f85a5

Added burn led test program
author Windel Bouwman
date Wed, 17 Jul 2013 22:31:54 +0200
parents
children
comparison
equal deleted inserted replaced
236:8786811a5a59 237:81752b0f85a5
1
2 /*
3 Demo of how to define types
4 */
5
6 package typedemo;
7
8 type int A;
9 type int B;
10 type struct {
11 int x, y;
12 A z;
13 } C;
14 type struct {
15 C x;
16 B y;
17 int z;
18 } D;
19
20 type D* E;
21
22 function int testcast()
23 {
24 var A a;
25 var B b;
26 a = 3;
27 b = a;
28 var C c;
29 c.x = a;
30 c.z = c.y;
31 var D d;
32 var E e;
33 var D* e2;
34 e = &d;
35 e2 = e;
36 e2->x.x = 22;
37
38 return 0;
39 }
40