assuming you can write up the variable, array definitions, void setup() to go with this:
x=0;
void loop(){
if (done_receiving == 0){ // more data expected
if (Serial.available()>0){
incomingArray [x] = Serial.read();
if (incomingArray [x] == done_character)
{ done_receiving = 1;
x = 0;}
else {x=x+1;}
} // end serial available
} // end done check
} // end void loop