Created a structure. I introduce 2 f.vozrast elements. I want to print, but prints only the second entered element f.vosrast .
struct sname { char fio[256]; int vozrast; }; sname f; int main() { SetConsoleCP(1251); SetConsoleOutputCP(1251); for (int i = 0; i < 2; i++) { cin >> f.vozrast; cout << "Возраст:" << f.vozrast; } return 0; } Apparently when you enter the second age, the result is overwritten in place of the first. How to Split f.vozrast on the "array" and could be f.vozrast in an elemental way?