[Gambas-user] gb3 RC1: using structures to replace the loss of Mk$ functions

Kevin Fishburne kevinfishburne at ...1887...
Sun Apr 3 22:09:55 CEST 2011


On 04/03/2011 09:33 AM, Jussi Lahtinen wrote:
>> With respect to Doriano, how would one use the memcpy() statement in
>> GAMBAS? I see from Wikipedia that "void *memcpy(void *dest, const void
>> *src, size_t n);" shows the syntax in C. My two questions are, how do
>> you call external library functions in gb, and how would you translate
>> the C syntax to gb syntax?
> Public Extern memcpy(pDest As Pointer, pSrc As Pointer, size As Integer) In
> "libc:6"
>
> Then example in Gambas;
> memcpy(Array1.Data, Array2.Data, Array2.Count * SizeOf(gb.Integer))

Awesome, thank you. That's a damn powerful ability that I didn't know 
about. Time to see what else useful is out there in C-land. :)

-- 
Kevin Fishburne
Eight Virtues
www: http://sales.eightvirtues.com
e-mail: sales at ...1887...
phone: (770) 853-6271





More information about the User mailing list