Skip to content

Instantly share code, notes, and snippets.

Created July 9, 2010 01:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/468890 to your computer and use it in GitHub Desktop.
Save anonymous/468890 to your computer and use it in GitHub Desktop.
decrement_array.c
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