History

new example array_zero.ck and corresponding test 119.ck

Ge Wang committed 3 years ago

Commit 77e9c401 parent dab707e2 files · +26 −0Browse files

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

Unified · Split

examples/array/array_zero.ck+14−0
@@ -0,0 +1,14 @@
1+// .zero() zeros out the contents AND keeps size unchanged
2+// version: need chuck-1.4.2.1 or higher
3+
4+// an array
5+[1,3,4] @=> int array[];
6+
7+// should print 3 3
8+<<< array[1], array.size() >>>;
9+
10+// zero out the array, leaving size as is
11+array.zero();
12+
13+// now should print 0 3
14+<<< array[1], array.size() >>>;

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