/***********************
|
|
* Datei: stackmain.c
|
|
* Speichern einer Menge von Punkten
|
|
*
|
|
* Rainer Hihn
|
|
*/
|
|
|
|
#include "pointStack.h"
|
|
|
|
void exit(int);
|
|
|
|
POINT readPoint()
|
|
{
|
|
POINT userPoint;
|
|
|
|
printf("Bitte x-Koordinate eingeben \n");
|
|
scanf("%62f", &userPoint.rX);
|
|
printf("Bitte y-Koordinate eingeben \n");
|
|
scanf("%62f", &userPoint.rY);
|
|
printf("Bitte z-Koordinate eingeben \n");
|
|
scanf("%62f", &userPoint.rZ);
|
|
|
|
return userPoint;
|
|
}
|
|
|
|
|
|
int main(void)
|
|
{
|
|
/**
|
|
* Variablendeklaration
|
|
*/
|
|
char cCmd;
|
|
|
|
printf("’p’ fuer Punkt eingeben, ’q’ fuer Ausgabe: \n");
|
|
|
|
while(1)
|
|
{
|
|
|
|
scanf("%c", &cCmd);
|
|
|
|
if(cCmd == 'p')
|
|
{
|
|
push(readPoint());
|
|
printf("’p’ fuer Punkt eingeben, ’q’ fuer Ausgabe: \n");
|
|
}
|
|
|
|
if(cCmd == 'q')
|
|
{
|
|
while(!isEmpty())
|
|
{
|
|
printStackElement(pop());
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
}
|