RosettaCodeData/Task/Copy-a-string/FreeBASIC/copy-a-string.basic

13 lines
318 B
Plaintext

' FB 1.05.0 Win64
Dim s As String = "This is a string"
Dim t As String = s
' a separate copy of the string contents has been made as can be seen from the addresses
Print s, StrPtr(s)
Print t, StrPtr(t)
' to refer to the same string a pointer needs to be used
Dim u As String Ptr = @s
Print
Print *u, StrPtr(*u)
Sleep