[Gambas-devel] declaration of pointers how?
Benoît Minisini
gambas at ...1...
Sat Jun 8 16:57:19 CEST 2013
Le 27/05/2013 23:30, PICCORO McKAY Lenz a écrit :
> i read the documentation and also the tutorial, but i have a problem..
>
> i try to implement finger print library fprint and there are many
> double pointers declarations, **var event *var..
>
> i decalre as Pointer var but how to this case of double pointers?
>
> NOTE: how could send code in maillist, mailman buch the mail if i send
> some gambas code
>
> Lenz McKAY Gerardo (PICCORO)
> http://qgqlochekone.blogspot.com
>
Sorry for the late answer!
Something like a "int **var" in C is just a pointer variable in Gambas.
You declare it as "Pointer".
Now, how to access the value? You use the Pointer@() Gambas function and
the others from the same family.
For example:
int func(int **var);
becomes:
Extern func(ppvar As Pointer) As Integer
And you use it that way:
Dim pvar As Pointer
' Send the address of pvar (which is a 'int *')
func(VarPtr(pvar))
' Now pvar contains a pointer that points at an integer
Print Int@(pvar)
--
Benoît Minisini
More information about the Devel
mailing list