Raised This Month: $ Target: $400
 0% 

[ Solved ] very fast question ...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Aooka
Veteran Member
Join Date: Aug 2011
Location: Villeurbanne
Old 06-27-2012 , 11:12   [ Solved ] very fast question ...
Reply With Quote #1

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
__________________
Pawn ? Useless
Aooka is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-27-2012 , 12:09   Re: [REQ] very fast question ...
Reply With Quote #2

The 2nd one doesn't even compile...
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 06-27-2012 , 12:15   Re: [REQ] very fast question ...
Reply With Quote #3

Quote:
Originally Posted by Exolent[jNr] View Post
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.
__________________

Last edited by Neeeeeeeeeel.-; 06-27-2012 at 12:21.
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 06-27-2012 , 12:25   Re: [REQ] very fast question ...
Reply With Quote #4

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" }

Last edited by Backstabnoob; 06-27-2012 at 12:25.
Backstabnoob is offline
Aooka
Veteran Member
Join Date: Aug 2011
Location: Villeurbanne
Old 06-27-2012 , 12:39   Re: [REQ] very fast question ...
Reply With Quote #5

No hum, i know it's useless but it's just to understand how the system work ^^

Thanks all !
__________________
Pawn ? Useless

Last edited by Aooka; 06-27-2012 at 12:39.
Aooka is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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