[PD-dev] Using & operator on t_symbol?

IOhannes m zmölnig zmoelnig at iem.at
Thu Mar 26 09:41:54 CET 2009


B. Bogart wrote:
> Hey all,
> 
> A gphoto function expects a variable argument in the following form:
> 
> char myvar[] = "10";
> 
> function(&myvar);
> 
> But I'd like to pass a symbol argument from PD.
> 
> function(&arg->s_name);
> 
> does not work. (no errors, the value just does not get set.)
> 
> What is the proper way to get the address of the s_name part of a t_symbol?

never ever change the value of a symbol. they are constants.
you will get crashes and everything.

if you have a function that wants to change strings, you have to use
stings and not symbols. (convert a symbol to a char[]; modify it; call
gensym() on the new string)

fgamdsr
IOhannes




More information about the Pd-dev mailing list