{{fbdoc item="title" value="Operator STRPTR (String pointer)"}}----
Returns the address of a string's character data.

{{fbdoc item="syntax"}}##
	[[KeyPgDeclare declare]] [[KeyPgOperator operator]] **Strptr** ( [[KeyPgByref byref]] //lhs// [[KeyPgAs as]] [[KeyPgString string]] ) [[KeyPgAs as]] [[KeyPgZstring zstring]] [[KeyPgPtr ptr]]
	[[KeyPgDeclare declare]] [[KeyPgOperator operator]] **Strptr** ( [[KeyPgByref byref]] //lhs// [[KeyPgAs as]] [[KeyPgWstring wstring]] ) [[KeyPgAs as]] [[KeyPgZstring zstring]] [[KeyPgPtr ptr]]
##
{{fbdoc item="usage"}}##
	//result// = **Strptr** ( //lhs// )
##
{{fbdoc item="param"}}
	##//lhs//##
		A string.

{{fbdoc item="ret"}}
	Returns a ##[[KeyPgZstring Zstring]] [[KeyPgPtr Ptr]]## to a string's character data.

{{fbdoc item="desc"}}
	This operator returns a ##[[KeyPgZstring Zstring]] [[KeyPgPtr Ptr]]## that points to the beginning of a string's character data. ##**Operator Strptr**## is the proper method for acquiring the address of a string's character data.

	Note that when passed a ##[[KeyPgWstring Wstring]]##, ##**Operator Strptr**## still returns a ##[[KeyPgZstring Zstring]] [[KeyPgPtr Ptr]]##, which may not be the desired result.

	The related ##[[KeyPgOpVarptr Operator Varptr (Variable pointer)]]## and ##[[KeyPgOpAt Operator @ (Address of)]]##, when used with a ##[[KeyPgString String]]##, return the address of the internal string descriptor.

{{fbdoc item="ex"}}
{{fbdoc item="filename" value="examples/manual/operator/strptr.bas"}}%%(freebasic)
'' This example uses Strptr to demonstrate using pointers with strings
Dim myString As String
Dim toMyStringDesc as any ptr
Dim toMyString As ZString Ptr

'' Note that using standard VARPTR notation will return a pointer to the
'' descriptor, not the string data itself
myString = "Improper method for Strings"
toMyStringDesc = @myString
Print myString
Print hex( toMyStringDesc )
Print

'' However, using Strptr returns the proper pointer
myString = "Hello World Examples Are Silly"
toMyString = StrPtr(myString)
Print myString
Print *toMyString
Print

'' And the pointer acts like pointers to other types
myString = "MyString has now changed"
Print myString
Print *toMyString
Print
%%

{{fbdoc item="diff"}}
	- New to ""FreeBASIC"", but does exactly the same thing as ##[[KeyPgSadd Sadd]]##

{{fbdoc item="see"}}
	- ##[[KeyPgSadd Sadd]]##
	- ##[[KeyPgOpVarptr Varptr]]##
	- ##[[KeyPgOpProcptr Procptr]]##
	- [[ProPgPointers Pointers]]

{{fbdoc item="back" value="CatPgOpPoint|Pointer Operators"}}{{fbdoc item="back" value="CatPgOpString|String Operators"}}{{fbdoc item="back" value="CatPgOperators|Operators"}}