문제

Is there any way to generate as a preprocessor macro and the use of the concatenate directive the cases for a switch-case statement. Im using C and I would like to create several cases for a switch.case statement as.

#define select_case(value) \
switch (values) \ Assume an enum with the values
case prefix_##value: \
break;\
default:\
break;\

That is a general idea. did you get me? Is it possible?

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top