Showing the changes to examples/array/array_assign.ck (1 of 486 files). Show all
Unified · Split
| @@ -0,0 +1,13 @@ | ||
| 1 | +// 17.ck : partial array | |
| 2 | + | |
| 3 | +// declare int array 2x2 | |
| 4 | +int x[2][2]; | |
| 5 | + | |
| 6 | +// assign | |
| 7 | +2 => x[1][1]; | |
| 8 | + | |
| 9 | +// assign partial array reference to 'y' | |
| 10 | +x[1] @=> int y[]; | |
| 11 | + | |
| 12 | +// test | |
| 13 | +if( y[1] == 2 ) <<<"success">>>; | |