[Gambas-user] [Fwd: Gambas3 Pointers example] signal #6
Demosthenes Koptsis
demosthenesk at ...626...
Sun Jan 9 22:17:44 CET 2011
yes i read the man and i know that is suggested not to use this
function.
Although i just use it for demonstration for pointers.
That i didn't do is to check the header files.
The other thing is that i am total newbie to man 3 and i need some time
to get used to it, so please be patient.
i see that the usage of external functions are more far than a medium
level of Basic programming but i think i can manage it in time.
On Sun, 2011-01-09 at 21:37 +0100, Benoît Minisini wrote:
> > 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,
>
--
Regards,
Demosthenes
More information about the User
mailing list