Quote:
Originally Posted by Freezo
Today i learned that when you declare a stock or a function like :
Код:
stock printf.one() { }
The compiler doesn't manage that, well because of the point ' .', and it gives an error of " Undefined symbol", but how can we fix that?
Well its really simple.
- First, we will need to declare a define
- the define will basically replace the real one.
Take a look:
Код:
#define printf. _replace_
Код:
stock printf.one() { }
stock printf.two() { }
stock printf.three() { }
What did i do? Well simply i create a define that replace the printf with _replace_ which the compiler will read it like this:
Код:
stock _replace_one() {}
stock _replace_two() {}
stock _replace_three {}
Done.
Edit: i didn't tough that its something made before: Here
|
does giving a point (like "printf.one") benefit the code? Or isit a naming preference?