Say you have a struct.
struct my_c_struct {};
my_c_struct *ptr = 0; // uninitialised pointer
You need to prototype the function with a pointer to a pointer
void my_func(my_c_struct **pptr);
void my_func(my_c_struct **pptr)
{
*ptr = new my_c_struct;
if (!*ptr) printf ("error no memory\n");
else printf ("aye memory\n");
}
On 10 June 2012 01:57, Vince Kuyatt <[email protected]> wrote:
> I need to be able to define a variable which is an un-initialized pointer
> to a C struct, then pass a reference to that pointer to a C function. How
> would I go about doing this?
> ____________________
> Racket Users list:
> http://lists.racket-lang.org/users
>
>
____________________
Racket Users list:
http://lists.racket-lang.org/users