Basic Array Construction

Category:
Arrays, Hash Tables and Dictionaries
Description: This sample demonstrates basic array construction.
Code:
let BasicConstruction() =

let emptyA = [||]

let smallNumsA = [|1; 2; 3|]

let emptyA2: int array = Array.zeroCreate 5

printfn "emptyA = %A" emptyA
printfn "\nsmallNumsA = %A" smallNumsA
printfn "\nemptyA2 = %A" emptyA2

Execution Result:
emptyA = [||]

smallNumsA = [|1; 2; 3|]

emptyA2 = [|0; 0; 0; 0; 0|]

Last edited Sep 14, 2011 at 2:44 AM by ttliu2000, version 1

Comments

No comments yet.