examples/oper/oper_assign.ck
raw| 1 | // 17.ck : partial array |
| 2 | |
| 3 | // assign 1 to newly declared int |
| 4 | 1 => int i; |
| 5 | |
| 6 | // increment assign i |
| 7 | 3 +=> i; |
| 8 | |
| 9 | // reference assignment |
| 10 | Object foo @=> Object @ bar; |
| 11 | |
| 12 | // (foo bar both reference same object) |
| 13 | |
| 14 | // declare int array 2x2 |
| 15 | int x[2][2]; |
| 16 | |
| 17 | // assign |
| 18 | 2 => x[1][1]; |
| 19 | |
| 20 | // assign partial array reference to 'y' |
| 21 | x[1] @=> int y[]; |
| 22 | |
| 23 | // test |
| 24 | if( y[1] == 2 ) <<<"success">>>; |