AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [ Solved ] very fast question ... (https://forums.alliedmods.net/showthread.php?t=188529)

Aooka 06-27-2012 11:12

[ Solved ] very fast question ...
 
I just want to know if it's the same :

Code:
new const szTitleMenuCt[ 12 ] = {     "Menu for Ct" };

&

Code:
new const szTitleMenuCt[ 1 ][ 12 ] = {     "Menu for Ct" };

although its quite useless :mrgreen:

Exolent[jNr] 06-27-2012 12:09

Re: [REQ] very fast question ...
 
The 2nd one doesn't even compile...

Neeeeeeeeeel.- 06-27-2012 12:15

Re: [REQ] very fast question ...
 
Quote:

Originally Posted by Exolent[jNr] (Post 1737288)
The 2nd one doesn't even compile...

I compile it :/ it is unnecessary, but it compiles.

It is not the same, it can work but it is unnecessary if you use just one string.

PHP Code:

new const szColors][ 16 ] = {
    
"White",
    
"Green",
    
"Black"
};

new const 
szColor116 ] = { "White" };
new const 
szColor216 ] = { "Green" };
new const 
szColor316 ] = { "Black" }; 

Both can work fine, but the first way it is better because you for example could do a loop for use it. And you create just one cost instead of three, in the other way.

Backstabnoob 06-27-2012 12:25

Re: [REQ] very fast question ...
 
Why do you even try to create a multidimensional array if you put only one string in it?

Code:
// you don't even need to limit the size of each string or the maximum number of items new multidimensional_array[][] = {      "string 1",      "string 2" }

Aooka 06-27-2012 12:39

Re: [REQ] very fast question ...
 
No hum, i know it's useless but it's just to understand how the system work ^^

Thanks all !


All times are GMT -4. The time now is 06:19.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.