When reading a file through getline
, \n
is written to the resulting character.
The data in the file is written like this (in this example, _
represent spaces):
2_
c_3_
a_1_
The first digit in the file is the number of records.
Code:
getline(autorisationFile, temp, ' ');
while (getline(autorisationFile, temp, ' ')) {
arr[i].login = temp;
getline(autorisationFile, temp, ' ');
arr[i].password = temp;
i++;
}