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
2float argh[0];
3
4// print
5<<< "array size:", argh.size() >>>;
6
7// resize
84 => argh.size;
9
10// print
11<<< "array size:", argh.size() >>>;
12
13// set elements
143.0 => argh[0];
154 => argh[1];
165.0 => argh[2];
176 => argh[3];
18
19// print
20<<< "contents:", "">>>;
21for( int i; i < argh.size(); i++ )
22 <<< "argh[", i, "]:", argh[i] >>>;
23
24// recap
252 => argh.size;
26
27// print
28<<< "array size:", argh.size() >>>;
29
30// clear the contents
31argh.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