In this code:
#include <stdio.h>
#include <stdlib.h>
struct cadastro {
char nome[50];
int idade;
char rua[50];
int numero;
};
int main()
{
struct cadastro c[4]; //Array[4] de estruturas
for(int i=0; i<4; i++) {
gets(c[i].nome);
scanf("%d", &c[i].idade);
gets(c[i].rua);
scanf("%d", &c[i].numero);
}
system("pause");
return 0;
}
How to give print on all elements of the struct, without doing it manually with a printf. For it will display four times.