【叶子出品】多年前闲的蛋疼写的字符串翻转
#Include "Windows.bi"#Include "crt/string.bi"
Sub swstr(BufferStr As ZString Ptr)
Dim nInLen As Integer = strlen(BufferStr)
Dim RetStr As UByte Ptr = Allocate(nInLen)
For i As Integer = 0 To nInLen-1
RetStr = Cast(UByte Ptr,BufferStr)
Next
CopyMemory(BufferStr,RetStr,nInLen)
DeAllocate(RetStr)
End Sub
Dim ts As ZString * 260
ts = "abcdefg"
Print ts
swstr(@ts)
Print ts
ts = "ruguoaiqingkeyishunjianwangji"
Print ts
swstr(@ts)
Print ts
sleep
页:
[1]