Infinite parameters with defines
#4

Ah, I might've misunderstood your question then. The preprocessor simply substitutes text, it's not a smart creature. So, your example turned into
pawn Код:
print("Hello there! First parameter is hello, the rest is wow", "cow", "bar")
and print accepts only single argument (in contrary to printf). Check this out:
pawn Код:
#include <a_samp>
   
#define fancy%9\32;voideater(%0,%1) printf("Hello there, the result is: "#%0,%1)

main() {
    fancy voideater("hello %s, %s, and %s", "wow", "cow", "bar");
}
Also, old playground ( http://slice-vps.nl/ppg/ ) has "Show preprocessed output" - it's really awesome macro resolver. Try it!
Reply


Messages In This Thread
Infinite parameters with defines - by RajatPawar - 06.03.2014, 08:33
Re: Infinite parameters with defines - by Misiur - 06.03.2014, 08:37
Re: Infinite parameters with defines - by RajatPawar - 06.03.2014, 08:42
Re: Infinite parameters with defines - by Misiur - 06.03.2014, 08:51
Re: Infinite parameters with defines - by RajatPawar - 06.03.2014, 09:03
Re: Infinite parameters with defines - by Misiur - 06.03.2014, 09:18
Re: Infinite parameters with defines - by RajatPawar - 06.03.2014, 09:35
Re: Infinite parameters with defines - by ColeMiner - 06.03.2014, 09:58

Forum Jump:


Users browsing this thread: 1 Guest(s)