Skip to content

Instantly share code, notes, and snippets.

/decrement_array.c

Created Jul 9, 2010
Embed
What would you like to do?
void decrement_the_array () {
int x, y, z, exception;
exception = 0;
for (x = 0; ! (exception) && x < ARRAY_WIDTH; x++) {
for (y = 0; ! (exception) && y < ARRAY_HEIGHT; y++) {
for (z = 0; ! (exception) && z < ARRAY_DEPTH; z++) {
if (array[x][y][z] == 0) {
exception = 1;
break;
}
array[x][y][z]--;
}
}
}
if (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
You can’t perform that action at this time.