Unnamed
public c v1 · immutable case REMOVEALL: /* removes ALL occurrences of <num> in the list, return number of elements removed */ for (i = 0; i < stack.size; i++) { int j; if (stack.data[i] == arg) /* found occurrence of <num> */ { n++; /* increment number of <num>'s found */ for (j = i; j+1 < stack.size; j++) /* shift the array over */ stack.data[j] = stack.data[j+1]; stack.size--; i--; /* this makes the loop check the SAME slot again, because the one replaced it with could possibly be <num> */ } }