How to expand macro and delete comma
问题 For example I want to write my own printf() alternative, but I have to perform calculations on the variable arguments: #define log(fmt_string, ...) my_log(fmt_string, pack_args(__VA_ARGS__), __VA_ARGS__) where pack_args(...) - is a macro too. How should I change this code to handle the only fmt_string presence scenario? log("Some message here"); 回答1: In P99 I have two macros #define P00_ARG( \ _1, _2, _3, _4, _5, _6, _7, _8, \ _9, _10, _11, _12, _13, _14, _15, _16, \ ... etc ... \ _153, _154,