I have a macro to convert a string to a list of characters:
#define TO_STRING(x) #x
#define CHAR_LIST_7(x) TO_STRING(x)[0] \
, TO_STRING(x)[1] \
, TO_STRING(x)[2] \
, TO_STRING(x)[3] \
, TO_STRING(x)[4] \
, TO_STRING(x)[5] \
, TO_STRING(x)[6]
e.g. usage: "CHAR_LIST_7(chicken)" gives "'c', 'h', 'i', 'c', 'k', 'e', 'n'" so it can be used in things like templates (e.g.: http://hpaste.org/47313/exand )
However, I would like to generalize this for any amount of characters (and not need to manually have to count the amount of characters)? So I could simply go: CHAR_LIST(arbitrary text). Any ideas or solutions ?