Macro, why?
-
Why is the second call mapped to the macro version?
void f() {
puts("func");
}
#define f() puts("macro")void main()
{
f();
f (); // <-- this line
(f)();
}Output messages:
macro
macro
func
Press any key to continue . . .Maxwell Chen
-
Why is the second call mapped to the macro version?
void f() {
puts("func");
}
#define f() puts("macro")void main()
{
f();
f (); // <-- this line
(f)();
}Output messages:
macro
macro
func
Press any key to continue . . .Maxwell Chen
Possibly because 'irrelevant' blanks are removed by the preprocessor before macro expansion happens? :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Possibly because 'irrelevant' blanks are removed by the preprocessor before macro expansion happens? :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]:-D
Maxwell Chen