1
I have a struct
to define the type DATA
.
typedef struct data {
int ano, mes, dia;
}DATA;
DATA nasc;
Now, I will read this information from the user input.
printf("Digite sua data de nascimento");
scanf("%d", &nasc.dia);
printf("/");
scanf("%d", &nasc.mes);
printf("/");
scanf("%d", &nasc.ano);
I would like to do this in a better way. Reading the three entries on the same line and printing the character /
after each entry.
How can I do that?? How to continue on the same line after an input??
This helps a lot! But I would still like to know if you have how to insert the bars between the inputs... for interface sake.
– Gabriel Hardoim