#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#define MAXSTRING 100
struct adresse
{
char vorname[MAXSTRING];
char nachname[MAXSTRING];
char strasse [MAXSTRING];
char ort[MAXSTRING];
char PLZ[MAXSTRING];
};
struct personendaten_struct
{
struct adresse *adresse;
char schuhgroesse[MAXSTRING];
char groesse[MAXSTRING];
};
typedef struct personendaten_struct personendaten;
void search_print_Person(FILE* text);
void search_print_Person(FILE* text)
{
int x=0;
int i=0;
char temp='x';
personendaten *p=NULL;
while(!feof(text))
{
fgets(p->adresse->vorname, sizeof(p->adresse->vorname), text);
fgets(p->adresse->nachname, sizeof(p->adresse->nachname), text);
fgets(p->adresse->strasse, sizeof(p->adresse->strasse), text);
fgets(p->adresse->ort, sizeof(p->adresse->ort), text);
fgets(p->adresse->PLZ, sizeof(p->adresse->PLZ), text);
fgets(p->schuhgroesse, sizeof(p->schuhgroesse), text);
fgets(p->groesse, sizeof(p->groesse), text);
fscanf(text,"%c",&temp);
i=atoi(p->schuhgroesse);
if(i < 38)
{
printf("%s",p->adresse->vorname);
printf("%s",p->adresse->nachname);
printf("%s",p->adresse->strasse);
printf("%s",p->adresse->ort);
printf("%s",p->adresse->PLZ);
printf("Schuhgroesse:%s",p->schuhgroesse);
printf("Groesse:%s",p->groesse);
printf("\n");
}
}
}
int main()
{
FILE*text = NULL;
text=fopen("adressen.txt","r");
if(text == NULL)
{
printf("Fehler beim LESEN der text adressen.txt");
exit(-1);
}
search_print_Person(text);
fclose(text);
return(0);
}