Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- proc newCString*( gcStr: string ): cstring =
- var size = len( gcStr )
- result = cast[cstring]( alloc( sizeof(char) * ( size + 1 ) ) )
- for i in 0..size:
- result[i] = gcStr[i]
- result[size] = '\0'
Advertisement
Add Comment
Please, Sign In to add comment