04.04.2016, 15:51
Neither loops are related to each other. The first loop will keep on looping and will continue to assign NULL data to the variables even after it passed the amount of rows you have because you're not taking the amount of rows in consideration.
The second loop will continue to loop for i < j AND i < MAX_BUILDINGS. You can't exceed MAX_BUILDINGS because I'm sure that your variable to access the enum is a 2D array of which the first set is limited by MAX_BUILDINGS:
So allowing your loop to go past this constant will result in array out of bounds errors.
The second loop will continue to loop for i < j AND i < MAX_BUILDINGS. You can't exceed MAX_BUILDINGS because I'm sure that your variable to access the enum is a 2D array of which the first set is limited by MAX_BUILDINGS:
PHP код:
new BuildingInfo[MAX_BUILDINGS][...];