static int myarray[100]; // Put a value in an array, ensuring that we // don't write past the end of the array. void PlaceValueInArray(int what, int where) { // Use mod operator (%) to ensure we're within the array. static myArray[where % 100] = what; }