Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var
- id: uint64
- inp = @["1", "user", "email"]
- #allocate memory for a cstring, the size of the string being copied
- var s1:cstring = cast[cstring] (alloc0((inp[1].len + 1) * sizeof(char)))
- s1 = inp[1]
- echo $s1
- #Works!
- copyMem(cast[pointer](addr s1), addr inp[1], sizeof(s1))
- echo $s1
- #Unicode char?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement