How to use X Macros in C

preview_player
Показать описание
X Macros are a powerful tool in C that I rarely see talked about. I have found it very useful in my own projects.
Рекомендации по теме
Комментарии
Автор

Yes dark sorcery! I love these time savers I hope you share more of them.

TheDarkelvenangel
Автор

Thank you for this short and crystal clear video ! I just had one question:

Let's say that you indeed want to be able to map an enum to strings, is there a way to make it reformat the name ?
Like if the enum is :
ANIMAL_SERVICE_DOG
ANIMAL_SERVICE_CAT ...

And you want your strings to be just :
Dog
Cat ...

Could you use x macros for that ?

TheRemo