[HELP]What's the difference here?

I saw some scripts here in SA-MP Forums with a difference between macros, I mean, between defines.

I saw two ways to define an hexadecimal code for colors (just an example):
pawn Код:
//First way, without brackets.
#define COLOR    0xFF0000FF
//Second way, with brackets.
#define COLOR    (0xFF0000FF)
What's the difference?

Thank you, and I'm sorry for my bad English.

Best regards!

I don't know any difference.
If you imagine a simple maths-exercise:

1 + 2 + 3 + 4 = 10
is the same as
(1) + (2) + (3) + (4) = (10)

So, probably no difference. If there is any, then I don't know about it.

Matter of organization / identification.

#define just replaces COLOR with whatever is after the first space

it will replace COLOR the first way with 0xFF0000FF
the second way with (0xFF0000FF)

it cant hurt to have the extra () but the first way could be bugged depending on your code.

so when your writing code imagine what it would look like both ways
only then will you see what the difference is.

Forum Jump:

Users browsing this thread: 1 Guest(s)