Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- memcpy(from:ptr, to:ptr, n:size) | effects [read from[0:n], write to[0:n]]
- reverse_half(s:string):string | effects [read s.buffer[0:s.length]]
- size n = s.length
- copy = new string(n)
- m = n - n / 2
- memcpy(copy.buffer, s.buffer + m, n/2)
- memcpy(copy.buffer + m, s.buffer, m)
- return copy
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement