Posts: 61
Threads: 19
Joined: May 2014
Reputation:
0
Hello guys.
I really want to know: what's the difference between #define and const?
Sorry for my English.
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
I've pondered over this myself a few times, because in a numerical context they aren't at all different. The only advantage I can think of using #define is that you can prepend it with a hash sign to turn it into a string. But that doesn't really work out if the number is between brackets (which it is in most cases).
Posts: 56
Threads: 14
Joined: Oct 2014
Reputation:
0
#define POSITION 100.0, 200.0, 300.0
const position= [100.0, 200.0, 300.0];
SetPlayerPos(playerid, POSITION);
SetPlayerPos(playerid, position[0], position[1], position[2]);
no test.