[PD-dev] shared class data and functions

Jonathan Wilkes jancsika at yahoo.com
Thu Nov 15 00:07:43 CET 2012

Thanks Charles and Martin!  I forgot the connection between pointers
and array math-- that's very helpful.

Two questions below:

> From: Martin Peach <martin.peach at sympatico.ca>
>To: Jonathan Wilkes <jancsika at yahoo.com> 
>Cc: pd-dev List <pd-dev at iem.at> 
>Sent: Wednesday, November 14, 2012 9:29 AM
>Subject: Re: [PD-dev] shared class data and functions


>> It seems like I should be able to do this but I can't figure out all the
>> pointer bs.
>Something like (t_foo *)x->member, or ((t_bar *)x)->member?

First, I noticed that I get a warning if I write the function to take an
argument of type t_object *x and I send it one of type t_theobjectname
*x.  So I'm guessing I should probably go back to my function calls
and explicitly cast to t_object*, is that right?

Second, (t_foo *)x->member will give me an error: "t_text has no member
named x_member".  I don't understand
why, because the following works:

t_foo *blah = (t_foo *)x;
blah->member etc...



More information about the Pd-dev mailing list