why do you need the "int time" parameter in the alarmHandler function if then you're not using it?
void alarmHandler(char messageIn, int time){
for (int i = 51; i > 0; i--){
messageArray[i] = messageArray[i-1];
}
messageArray[0] = messageIn;
}
is that your whole code? I'm note sure what you are trying to do...