Last Array element
Is there a way to determine the last element in an array?
i.e. Code:
new array[5]like an EOS for cells. * preferably without looping through it |
Re: Last Array element
Are you checking the array's slot which has some data (rather than "0") or just want to get the last slot regardless if it's been used?
To get the last possible array slot: Code:
|
Re: Last Array element
Quote:
i.e. in my above code i want 3 as the return Sorry....forgot to specify. |
Re: Last Array element
Code:
|
Re: Last Array element
Quote:
Not quite where i'm trying to go with the code, ya know? EDIT: actually....if i wanted to go that in depth i'd use bitsums instead of arrays |
Re: Last Array element
without dynamic array and without looping i think the only way is to have a int that you increace every time you fill a cell of an array
edit: i figured something out :P if you dont use 0-s as cells values you could use Code:
|
Re: Last Array element
Quote:
I was wondering if there's a native already for it. if not....i'll fucking make one! :D |
Re: Last Array element
doesent have to be chars, but the values have to be 0 < n < 128 i think :D
|
Re: Last Array element
Code:
|
Re: Last Array element
Quote:
Quote:
|
| All times are GMT -4. The time now is 15:16. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.