If you wanted an array of numeric values, it should have been initialized as {1,2,3,4,5}. Putting the numerals in single quotes means they are characters, and the 49, 50, 51,... you are seeing are the ASCII codes for the characters '1', '2', '3', '4'.