Created
July 9, 2010 01:13
-
-
Save anonymous/468890 to your computer and use it in GitHub Desktop.
decrement_array.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void decrement_the_array () { | |
int x, y, z; | |
for (x = 0; x < ARRAY_WIDTH; x++) { | |
for (y = 0; y < ARRAY_HEIGHT; y++) { | |
for (z = 0; z < ARRAY_DEPTH; z++) { | |
if (array[x][y][z] == 0) { | |
goto exception; | |
} | |
array[x][y][z]--; | |
} | |
} | |
} | |
return; | |
exception: | |
error ("element (%d, %d, %d) already equals zero"); | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment