Easy-to-answer question about #define value
#1

Do they use memory? I've to know this because i'm planning to use alot.
Reply
#2

They're only used by the compiler.

Here is a lot of useful information for you: https://sampforum.blast.hk/showthread.php?tid=166680
Reply
#3

Well yes.

Код:
#define VALUE 1

new getvalue = VALUE;
if(getvalue == 1)
{
    //the value is 1
}
Reply
#4

Quote:
Originally Posted by currencyinstacks
Посмотреть сообщение
Well yes.

Код:
#define VALUE 1

new getvalue = VALUE;
if(getvalue == 1)
{
    //the value is 1
}
The defines themselves don't use memory, as they're 'replaced' at compile time.

For example:
pawn Код:
#define VALUE 5
if(VALUE == 5)
Would, after compile, become:
pawn Код:
if(5 == 5)
I recommend you read the PAWN language guide.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)