You have to specify the length arguments that are needed with %s
. Please, try to use the _countof
macro:
while (_ftscanf_s(fileIn, _T("%hu %lu %s %s %hu"), &student.identifier, &student.registerNumber,
student.surname, _countof(student.surname), student.name, _countof(student.name), &student.mark) != EOF)
{
}