> means it can only take an actual hardcoded string.
if with "hardcoded" you mean a string constant, then the answer is no. "s" is a pointer to any c string, the const part only means that gensym() promises not to modify the string.
google "const correctness".
> Can this convert floats to symbols?
use a char array together with snprintf, e.g.:
char buf[100];
snprintf("foo-%f", sizeof(buf), someFloatValue); // NOTE: you should check the return value, if you want to be safe, see https://linux.die.net/man/3/snprintf
gensym(buf);
Christof
Gesendet: Freitag, 22. März 2019 um 17:31 Uhr
Von: "Chuckk Hubbard" <badmuthahubbard@gmail.com>
An: Pd-dev <pd-dev@iem.at>
Betreff: Re: [PD-dev] Converting arbitrary strings to symbol in an external
Thank you.
I have read it.
I understood that the "const" part of "const char *s) means it can only take an actual hardcoded string. Can this convert floats to symbols?
_______________________________________________ Pd-dev mailing list Pd-dev@lists.iem.at
https://lists.puredata.info/listinfo/pd-dev