#include <stdio.h>
#include <stdlib.h>
const adressen = 100, astring = 26;
void suche(int mode,struct str_adresss ad){
FILE *file;
// datei öffnen
if((file = fopen("adressen.dat","w+")) != NULL){
// adressdaten einlesen und nach Korrektheit überprüfen (Länge stimmt?)
//und gegebenenfalls Fehlermeldungen ausgeben.
if(mode == 1){
}else if (mode == 2){
}else {
//printf("3\n");
}
}
}
int main(int argc, char *argv[])
{
char option;
struct str_adress {char prename[astring];
char name[astring];
char telnr[astring];
} adress;
do{
printf(" N : Suchen nach Nachname \n V : Suchen nach Vorname \n T : Suchen nach Telefonnummer \n Q : Programmabbruch \n");
printf("\n Wählen Sie eine Option: ");
if (scanf("%s",&option)){
printf("\n");
switch (option){
case 'n':suche(1,adress);break;
case 'N':suche(1,adress);break;
case 'v':suche(2,adress);break;
case 'V':suche(2,adress);break;
case 't':suche(3,adress);break;
case 'T':suche(3,adress);break;
}
if (option != 'n' && option != 'v' && option != 't' && option != 'q' &&
option != 'N' && option != 'V' && option != 'T' && option != 'Q'){ printf("\n unzulaessige Eingabe fuer Optionen!\n\n");}
}while( option != 'q');
system("PAUSE");
return 0;
}