In an Array, how to limit the values that are inputted by the users from the keyboard??

use an if statement with ascii key codes. like if you want the values to just be numbers, you look up the range that are just numbers and convert the user input into ascii and if it is not in the range that is allowed then don't add it to the array.