Quote:
Originally Posted by HamletEagle
I'm bored and I kinda want to review a plugin so I thought let's do something "fun" or at least different. The first person who answers the following question correctly will get to choose what plugin I'll review next(maybe you made that awesome plugin or mod and no approver bothered with it for 5 years - this is your chance).
PHP Code:
#define PRINT_SQUARE(%1) server_print("%d", %1 * %1)
new x = 2 PRINT_SQUARE(x + 1)
What's the output of the call PRINT_SQUARE(x + 1)? WHY? What if instead of the macro we had a function?
|
Don't use macros, and don't use old 1.6 syntax. It's
{{CURRENTYEAR}} for god sake.
int x = 2; and do a function like a normal person. Macros are (apparently) going to be unsupported in the future (don't quote me on that)