summary refs log blame commit diff stats
path: root/compiler.nimble
blob: f4da45519d82540d457b20b14d8842bdc08321d0 (plain) (tree)
pan class="w"> : static[int], s: string): array[N, char] = doAssert s.len <= N let x = cast[ptr array[N, char]](s.cstring) x[] proc toCharArray2(N : static[int], s: string): array[N, char] = doAssert s.len <= N let x = cast[ptr array[N, char]](s.cstring) result = x[] let x = toCharArray1(10, "abc0123456") let y = toCharArray2(10, "abc0123456") echo "x = ", $x, " and y = ", $y