just read in until you get a newline character

Code:
file.getline(array,maxsizeofarray,'\n');