Raised This Month: $ Target: $400
 0% 

Last Array element


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 07-05-2012 , 16:47   Re: Last Array element
Reply With Quote #7

Quote:
Originally Posted by jimaway View Post
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
if you dont use 0-s as cells values you could use
Code:
new index = (array[charsmax(array)]) ? charsmax(array) : strlen(array)
either way....wouldn't that code return strlen(array)? because charsmax would give that anyway.....and my array is going to be filled with scalars (enums specifically), not chars


I was wondering if there's a native already for it. if not....i'll fucking make one!
__________________
What an elegant solution to a problem that doesn't need solving....

Last edited by Liverwiz; 07-05-2012 at 16:48.
Liverwiz 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 15:16.


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