Raised This Month: $ Target: $400
 0% 

checking array length, and creating them dynamically


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
orglee
Member
Join Date: Dec 2005
Old 12-03-2007 , 13:03   checking array length, and creating them dynamically
Reply With Quote #1

Hello.
I want to create array then use it in loop so i need its length.
Are there some array_fill and count functions ?
orglee is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 12-03-2007 , 13:13   Re: checking array length, and creating them dynamically
Reply With Quote #2

"sizeof" E.g:
Code:
new Array[32];
sizeof Array - will return 32;
 
or
 
new Array[32][128];
sizeof Array[] - will return 128, if you do only "sizeof Array" will return 32.
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
orglee
Member
Join Date: Dec 2005
Old 12-03-2007 , 13:16   Re: checking array length, and creating them dynamically
Reply With Quote #3

Thank you very much
orglee is offline
M249-M4A1
I <3 Mac
Join Date: May 2005
Location: Not interested
Old 12-03-2007 , 17:55   Re: checking array length, and creating them dynamically
Reply With Quote #4

Oh, and if you wanted to do stuff to the array's elements, be sure that when you loop, you do sizeof - 1, because if you did something with array[32], in Alka's example, you would get errors because array[32] doesnt exist
__________________
M249-M4A1 is offline
Reply


Thread Tools
Display Modes

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 11:07.


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