|
|
@ -1,4 +1,5 @@ |
|
|
|
#include"mainMenu.h" |
|
|
|
#include"createCustomer.c" |
|
|
|
|
|
|
|
|
|
|
|
bool agePermission(int age) |
|
|
@ -23,7 +24,7 @@ bool checkIfInteger(char* userInput) |
|
|
|
void ageInput() |
|
|
|
{ |
|
|
|
|
|
|
|
char* userInput = malloc(20*sizeof(char*)); |
|
|
|
char* userInput = malloc(20*sizeof(char)); |
|
|
|
char* userInputPointer; |
|
|
|
|
|
|
|
long age; |
|
|
@ -31,6 +32,8 @@ void ageInput() |
|
|
|
printf("\nPlease specify your age : "); |
|
|
|
scanf("%s",userInput); |
|
|
|
|
|
|
|
int c; |
|
|
|
while ((c = getchar()) != '\n' && c != EOF) {}; |
|
|
|
|
|
|
|
while (true) |
|
|
|
{ |
|
|
@ -38,10 +41,10 @@ void ageInput() |
|
|
|
|
|
|
|
if((checkIfInteger(userInput))&& (agePermission(age))) |
|
|
|
{ |
|
|
|
//age = strtol(userInput,&userInputPointer,10); |
|
|
|
|
|
|
|
printf("Access granted!\n\n\n\n"); |
|
|
|
age = strtol(userInput,&userInputPointer,10); |
|
|
|
|
|
|
|
//printf("Access granted!\n\n\n\n"); |
|
|
|
collectCustomerProperties(); |
|
|
|
showMenu(); |
|
|
|
|
|
|
|
break; |
|
|
@ -61,7 +64,9 @@ void ageInput() |
|
|
|
{ |
|
|
|
printf("input invalid! try again!\n"); |
|
|
|
|
|
|
|
fflush(stdin); |
|
|
|
scanf("%s",userInput); |
|
|
|
fflush(stdin); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|