[Gambas-user] external functions and struct

Demosthenes Koptsis demosthenesk at gmail.com
Thu Jun 14 11:25:12 CEST 2018


According to gambas wiki

*If the function returns a|struct ABC *|*, then you mimic the 
structure|ABC|declaration somewhere, and you declare the return value 
as|Struct ABC|.

here the function returns a struct mallinfo.

'struct mallinfo mallinfo (void)

so i created a Struct Mallinfo
and i declare an external function As Struct Mallinfo

Public Extern mallinfo() As Struct Mallinfo
why this is wrong ?

On 06/14/2018 11:55 AM, Benoît Minisini wrote:
> Le 14/06/2018 à 10:49, Demosthenes Koptsis a écrit :
>> i get an error with the following any help?
>>
>> Public Struct Mallinfo
>>    arena As Integer
>>    ordblks As Integer
>>    smblks As Integer
>>    hblks As Integer
>>    hblkhd As Integer
>>    usmblks As Integer
>>    fsmblks As Integer
>>    uordblks As Integer
>>    fordblks As Integer
>>    keepcost As Integer
>> End Struct
>>
>> 'struct mallinfo mallinfo (void)
>> Public Extern mallinfo() As Struct Mallinfo
>>
>>
>> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>
> Have you read http://gambaswiki.org/wiki/doc/extern ?
>
> Do you know C ?
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20180614/84621847/attachment.html>


More information about the User mailing list