# C++ getline() function.



## deangg (Oct 29, 2003)

I've got a 50 line text file containing 40 characters per line. Also an array of 50 structures where each structure contains 4 arrays.

I want to allocate the first 10 characters of each line into it's appropriate array, then the proceeding 10 characters on the same line into it's appropriate array (member._.fName) and so on.

The loop below assigns the first 10 characters of the text file to array "member[0].lName". It then seems to ignore all other statements leaving me with only ONE array of 200 filled. Can someone have a look at it for me please?

for(int i=0; i<50; i++)

{

fsInFile.getline(member.lName, 10);	
fsInFile.getline(member.fName, 10);
fsInFile.getline(member.mName, 10);	
fsInFile.getline(member.sName, 10);

}_


----------

