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_argument.ck (1 of 486 files). Show all

Unified · Split

examples/array/array_argument.ck+19−0
@@ -0,0 +1,19 @@
1+// array pass by reference test - should change values?
2+
3+// function that takes array
4+fun void mirror( int arg[] )
5+{
6+ // assign 0th element to 1st element
7+ arg[0] => arg[1];
8+}
9+
10+// declare array
11+int foo[2];
12+2 => foo[0];
13+1 => foo[1];
14+
15+// call the function
16+mirror( foo );
17+
18+// test
19+if ( foo[0] == foo[1] ) <<<"success">>>;

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