help me~ for use..... #define macro ## #@ #
-
#define FUNC_1(x) (x+1) #define FUNC_2(x) (x+2) #define FUNC_3(x) (x+3) #define FUNC_4(x) (x+4) #define FUNC_N(n, x) (FUNC_##n(x)) ---------------------------------------- int result1 = FUNC_N(1, 100);//OK but i want to below: int a = 1; int result2 = FUNC_N(a, 100);//NG please help ~
-
#define FUNC_1(x) (x+1) #define FUNC_2(x) (x+2) #define FUNC_3(x) (x+3) #define FUNC_4(x) (x+4) #define FUNC_N(n, x) (FUNC_##n(x)) ---------------------------------------- int result1 = FUNC_N(1, 100);//OK but i want to below: int a = 1; int result2 = FUNC_N(a, 100);//NG please help ~
Please don't cross-post. See [my answer](https://www.codeproject.com/Messages/5541483/Re-help-me-for-use-sharpdefine-macro-sharpsharp-sh.aspx) in Algorithms.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.