#include <stdio.h>

struct persontyp
{
   char vorname[30];
   char nachname[30];
   unsigned long gebdat; /* JJJJMMTT */
};
/****************************/
void printperson(struct persontyp pe)
{
   printf("Vorname: %s\n", pe.vorname);
   printf("Nachname: %s\n", pe.nachname);
   printf("Geburtsdatum: %ld\n", pe.gebdat);
}
/****************************/
struct persontyp scanperson(void)
{
   struct persontyp erg={"","",0};
   printf("Vorname:");   
   scanf("%29[^\n]", erg.vorname);
   while(getchar()!='\n'){}
   
   printf("Nachname:");  
   scanf("%29[^\n]", erg.nachname);
   while(getchar()!='\n'){}
   
   printf("Geburtsdatum (JJJJMMDD):"); 
   scanf("%lu", &erg.gebdat);
   while(getchar()!='\n'){}

   return erg;
}
/****************************/
int main(void)
{
   struct persontyp person;
   printf("----Eingabe:----\n");
   person = scanperson();

   printf("----Ausgabe:----\n");
   printperson(person);
   return 0;
}
