source:
CIVL/mods/dev.civl.com/examples/showStates/structsArray.cvl@
cb4d4f4
| Last change on this file since cb4d4f4 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 276 bytes | |
| Rev | Line | |
|---|---|---|
| [9fce4f1] | 1 | typedef struct Point{ |
| 2 | double x; | |
| 3 | double y; | |
| 4 | } Point; | |
| 5 | ||
| 6 | typedef struct Line{ | |
| 7 | Point start; | |
| 8 | Point end; | |
| 9 | } Line; | |
| 10 | ||
| 11 | void main(){ | |
| 12 | Point p0={0,0}, p1={1,1}, p2={2,2}; | |
| 13 | Line l0={p0, p1}, l1={p1,p2}, l2={p2, p0}; | |
| 14 | Line lines[3]; | |
| 15 | ||
| 16 | lines[0]=l0; | |
| 17 | lines[1]=l1; | |
| 18 | lines[2]=l2; | |
| 19 | } | |
| 20 |
Note:
See TracBrowser
for help on using the repository browser.
