[PD] atom_getsymbol

IOhannes m zmoelnig zmoelnig at iem.at
Wed Jan 11 10:03:35 CET 2017


On 2017-01-11 06:37, Ricky Graham wrote:
> void *pclass_new(t_symbol *s) {
> post("%s", *s); //this prints ā€œDā€ to the console
> }

oh my!

how about, looking up the definition of t_symbol in m_pd.h?
    typedef struct _symbol
    {
      char *s_name;
      struct _class **s_thing;
      struct _symbol *s_next;
    } t_symbol;

so the *only* proper way to access the string within a symbol is by
dereferencing the s_name member.

    post("%s", s->s_name);

fgam,df
IOhannes

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20170111/0c248d06/attachment.sig>


More information about the Pd-list mailing list