我是C編程新手,我很難理解下面的代碼是做什麼的?宏中的「##」是什麼意思,我也不太明白我們在例如f1的宏定義中如何,但沒有參數。斜槓在C語言的宏定義中意味着什麼?
我的問題是不同的,因爲我也有數倍定義
#include <stdio.h>
int a=1, b=2;
#define M(a,b) a ## b(a)
#define a t(f1,t(f1,f2(b)))
#define b(x) t(f2,t(f2,f1(a)))
#define ab(x) a+b(b)
typedef int (*i2i)(int);
int f1(int x) { return (++x); }
int f2(int x) { return (--x); }
int t(i2i f,int x) {return(f(f(x)));}
int main()
{
printf("%d\n%d", M(a,b), ab(5));
return (0);
}
這段代碼顯然不是要被理解的。它有什麼可能的用途,但只有娛樂? –
@LeeDanielCrocker競賽:) – user2085124