4
#define power(a) #a
int main()
{
printf("%d",*power(432));
return 0;
}
任何人都可以解釋o/p?
the o/p is任何人都可以解釋輸出
#define power(a) #a
int main()
{
printf("%d",*power(432));
return 0;
}
任何人都可以解釋o/p?
the o/p is任何人都可以解釋輸出
它等效於:
printf("%d",*"432");
這相當於:
printf("%d", '4');
和'4'
ASCII值是52
。
#define power(a) #a //# is a stringization operation in macro
int main()
{
printf("%d",*power(432));
return 0;
}
Hence after calling power(432), macro will return it "432" and applying * on it gives first value which is nothing but 52 (48 + 4) for '4' .
您認爲它有什麼作用?你有沒有努力理解這個代碼?這是微不足道的。 – 2013-03-02 14:13:52
我不明白'*'是什麼? – akash 2013-03-02 14:17:24
在這種情況下,您最需要閱讀基本的C語言教程。它用於指針取消引用。 – 2013-03-02 14:17:53