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

Two questions below:

>________________________________
> From: Martin Peach <[email protected]>
>To: Jonathan Wilkes <[email protected]> 
>Cc: pd-dev List <[email protected]> 
>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...

-Jonathan


>
>Martin
>
>
>
>

_______________________________________________
Pd-dev mailing list
[email protected]
http://lists.puredata.info/listinfo/pd-dev

Reply via email to