Is there a macro that can get a text as input like "abc" and then extract characters in that text and generate a code using them, something like "{'a','b','c'}" ?

Ancient Dragon

Not a macro, but you can easily write a function to do that. Give it a try and see what you can gome up with.

Actually i'm talking about preprocessing here, so what does a function have to do with preprocessing ?

Well look at Boost::Preprocessor, if there isn't a way to do this with that library, there is no way to do it period. There is BOOST_PP_STRINGIFY which takes a non-literal string like just abc and turns it into a literal string "abc". There might be other things of that flavour and that would somehow achieve what you desire.

This question has already been answered. Start a new discussion instead.