History

moving examples to top dir

Ge Wang committed 9 years ago

Commit 35ca2f61 parent fd011ef486 files · +-44 −-44Browse files

Showing the changes to examples/array/array_resize.ck (1 of 486 files). Show all

Unified · Split

examples/array/array_resize.ck+35−0
@@ -0,0 +1,35 @@
1+// instantiate a float array
2+float argh[0];
3+
4+// print
5+<<< "array size:", argh.size() >>>;
6+
7+// resize
8+4 => argh.size;
9+
10+// print
11+<<< "array size:", argh.size() >>>;
12+
13+// set elements
14+3.0 => argh[0];
15+4 => argh[1];
16+5.0 => argh[2];
17+6 => argh[3];
18+
19+// print
20+<<< "contents:", "">>>;
21+for( int i; i < argh.size(); i++ )
22+ <<< "argh[", i, "]:", argh[i] >>>;
23+
24+// recap
25+2 => argh.size;
26+
27+// print
28+<<< "array size:", argh.size() >>>;
29+
30+// clear the contents
31+argh.clear();
32+
33+// print
34+<<< "array size:", argh.size() >>>;
35+

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t