[Gambas-user] Development Version

Benoit Minisini gambas at ...1...
Mon Apr 24 22:16:51 CEST 2006


On Monday 24 April 2006 22:11, Scott, Vince wrote:
> I am using the Extern ability of the development version to access C
> libraries. I am having an issue figuring out how to pass a char* or to
> get a string from a C function. Has anyone used this feature and do you
> know the syntax to make it work?
>
> // C Side of things
>
>
> int foo(char* p_str)
> {
>    sprintf(p_str, "%s\n", "test");
>
>    return sizeof(p_str);
> }
>
> char* foo2()
> {
>    char str[6];
>
>     sprintf(p_str, "%s\n", "test");
>
>    return p_str;
> }
>
>
> How do I call these from Gambas to get the string returned? Everything I
> have tried crash the app.
>
>
> Thanks,
> Vince
>

Didn't you see what I answered you about sending strings to C functions on the 
development mailing-list ? Maybe it wasn't clear ?

-- 
Benoit Minisini





More information about the User mailing list