Advertisement
tinyevil

Untitled

Feb 26th, 2018
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. memcpy(from:ptr, to:ptr, n:size) | effects [read from[0:n], write to[0:n]]
  2.  
  3. reverse_half(s:string):string | effects [read s.buffer[0:s.length]]
  4. size n = s.length
  5. copy = new string(n)
  6. m = n - n / 2
  7. memcpy(copy.buffer, s.buffer + m, n/2)
  8. memcpy(copy.buffer + m, s.buffer, m)
  9. return copy
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement