[Gambas-user] [Fwd: Gambas3 Pointers example] signal #6

Benoît Minisini gambas at ...1...
Sun Jan 9 21:37:25 CET 2011


> so what can i do for
> 
> char *getwd(char *buf);
> 
> ?
> 

You must know C programming first, and understand how getwd works. By typing 
'man getwd', you will learn that you must not use that function, it is 
dangerous and so deprecated.

Then you will read that buf must be a pointer to a memory allocation of 
PATH_MAX bytes. You must find the value of this constant inside the standard C 
header files.

SizeOf(gb.String) is 4 (on 32 bits system). It is the number of bytes used by 
Gambas to store a pointer to a Gambas string. This is the reason why you get a 
crash.

Regards,

-- 
Benoît Minisini




More information about the User mailing list