28.05.2013, 15:13
What if I did have thousands of houses? How would you recommend future-proofing this script? Are there things I can do to make sure that we're as quick & efficient as possible?
NEW QUESTION:
I also from time to time need to find the lowest slot in an array that's "empty" (all zeros).. To do this I've been looping, again.. As such. Is this the most efficient way of finding the first empty slot in an array?
NEW QUESTION:
I also from time to time need to find the lowest slot in an array that's "empty" (all zeros).. To do this I've been looping, again.. As such. Is this the most efficient way of finding the first empty slot in an array?
Код:
new newArrID; for(new i=0;i<MAX_PROPERTIES;i++) { if(HomeInfo[i][homeID] == 0) { // I'm able to check for homeID being zero because this value is assigned by DB. newArrID = i; break; } } printf("Create home in array slot %i", newArrID);