There is a structure
struct Informer { char item[20]; char Platform[20]; char TimeBack[20]; }; And filling it out of the file
ifstream in; Informer mas[20]; in.open("1.txt"); int i = 1; int n = 0; while (!in.eof()) { n++; if (n != 4) switch (n) { case 1: in >> mas[i].item; break; case 2: in >> mas[i].Platform; break; case 3: in >> mas[i].TimeBack; } else { n = 0; i++; } } How to stuff it into a function?