// Ex650.cc // Sec. 6.5 of lecture // Dynamic array of type student // Input: a.out < input.522 #include main() { struct Student { long long int matrikel; int skz; char name[30], vorname[20]; }; int i, n; Student gruppe[4]; //array of Student cout << endl; cout << " How many Students : "; cin >> n; // input n if ( n <= 4) { for (i = 0; i < n; i++) { cout << endl << "Student nr. " << i << endl; cout << "Familenname : "; cin >> gruppe[i].name; cout << "Vorname : "; cin >> (gruppe+i)->vorname; cout << "Matrikelnummer : "; cin >> gruppe[i].matrikel; cout << "SKZ : "; cin >> gruppe[i].skz; } cout << endl; } i = 3; cout << endl; cout << "Student nr. " << i << " : "; cout << gruppe[i].vorname << " " << gruppe[i].name << " , "; cout << gruppe[i].matrikel << " , " << gruppe[i].skz << endl; }