Raised This Month: $ Target: $400
 0% 

Solved Why 33+32?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-30-2020 , 11:58   Re: Why 33+32?
Reply With Quote #2

It must be 33 as the elements in the array sized at 32 are accessed with 0 to 31. If you size it at 32, you will get index out of bounds if a player connects on the last slot (32).

sizing at 33 allows slots of 0 to 32. The first slot of 0 is technically a waste but this required to allow 32 to be a valid slot.

The second part of your example variable is sized at 32 for the max length of a string value.
__________________

Last edited by Bugsy; 12-30-2020 at 12:00.
Bugsy is offline
 



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 14:12.


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