ok i made this example
PUBLIC SUB Main()
DIM p AS Pointer
DIM s AS String
DIM a AS String = "this is a string" & Chr$(0)
PRINT Len(a)
PRINT InStr(a, Chr$(0))
p = Alloc(a)
'READ #p, s
s = StrPtr(p)
PRINT Len(s)
PRINT InStr(s, Chr$(0))
Free(p)
END
-
Before
> i just compared the output
> with PRINT s and i saw the same result.
>
> i was wrong because i did not know about string manipulation in c.
> i did not understand the zero terminated string you mentioned in help.
>
> i found some info at this page
> http://www.dfstermole.net/OAC/hstrings.html
>
i just compared the output
with PRINT s and i saw the same result.
i was wrong because i did not know about string manipulation in c.
i did not understand the zero terminated string you mentioned in help.
i found some info at this page
http://www.dfstermole.net/OAC/hstrings.html
Is there any wa
> i made an example for StrPtr, it is the next one,
>
> ' Gambas module file
>
> PUBLIC SUB Main()
>
> DIM p AS Pointer
> DIM s AS String
>
> p = Alloc("this is a string")
>
> 'READ #p, s
> s = StrPtr(p)
> PRINT s
> Free(p)
>
> END
>
> I just want to question what is the difference between
>
i made an example for StrPtr, it is the next one,
' Gambas module file
PUBLIC SUB Main()
DIM p AS Pointer
DIM s AS String
p = Alloc("this is a string")
'READ #p, s
s = StrPtr(p)
PRINT s
Free(p)
END
I just want to question what is the difference between
'READ #p, s
s = StrPtr(p)
both of the