Guest User

Untitled

a guest
Feb 15th, 2016
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. proc newCString*( gcStr: string ): cstring =
  2. var size = len( gcStr )
  3.  
  4. result = cast[cstring]( alloc( sizeof(char) * ( size + 1 ) ) )
  5. for i in 0..size:
  6. result[i] = gcStr[i]
  7.  
  8. result[size] = '\0'
Advertisement
Add Comment
Please, Sign In to add comment