Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
17
Task/Arrays/OCaml/arrays.ocaml
Normal file
17
Task/Arrays/OCaml/arrays.ocaml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
# Array.make 6 'A' ;;
|
||||
- : char array = [|'A'; 'A'; 'A'; 'A'; 'A'; 'A'|]
|
||||
|
||||
# Array.init 8 (fun i -> i * 10) ;;
|
||||
- : int array = [|0; 10; 20; 30; 40; 50; 60; 70|]
|
||||
|
||||
# let arr = [|0; 1; 2; 3; 4; 5; 6 |] ;;
|
||||
val arr : int array = [|0; 1; 2; 3; 4; 5; 6|]
|
||||
|
||||
# arr.(4) ;;
|
||||
- : int = 4
|
||||
|
||||
# arr.(4) <- 65 ;;
|
||||
- : unit = ()
|
||||
|
||||
# arr ;;
|
||||
- : int array = [|0; 1; 2; 3; 65; 5; 6|]
|
||||
Loading…
Add table
Add a link
Reference in a new issue