PDA

View Full Version : Question for define


FreshRio
01/01/2012, 09:58 AM
Hi,

Just a small question with defining.

Lets say I define this:

#define Build "20"


Then under OnGameModeInit:

new mapname[ 100 ];
format( mapname, sizeof( mapname ), "mapname Build: "#Build"" );
SendRconCommand( mapname );



So whats the correct one?

"#Build"
or
"Build"

Thanks

Nero_3D
01/01/2012, 11:15 AM
None of them, its just Build

Your example code would work because you put #Build there

But thats enough
SendRconCommand("mapname Build: " Build);

If you put something in quotes the compiler think its a string and wont change it
"Build" and "#Build" wouldnt change at all

The # just converts the work behind it into a string