|
|
@ -82,18 +82,15 @@ bool isValidPhoneNumber(char *phoneNumber) |
|
|
|
|
|
|
|
bool isValidAdress(char *street,char* city,int houseNumber,int postalCode) |
|
|
|
{ |
|
|
|
int lengthMax = 20; |
|
|
|
int LengthMin = 3; |
|
|
|
bool validStreet = true; |
|
|
|
bool validHouseNumber = true; |
|
|
|
bool validCity = true; |
|
|
|
bool validpostalCode = true; |
|
|
|
if(strlen(street)>lengthMax || strlen(street)<LengthMin) |
|
|
|
if(strlen(street)>maximalAdressLength || strlen(street)<minimalAdressLength) |
|
|
|
{ |
|
|
|
validStreet = false; |
|
|
|
} |
|
|
|
|
|
|
|
if(strlen(city)>lengthMax || strlen(city)<LengthMin) |
|
|
|
if(strlen(city)>maximalAdressLength || strlen(city)<minimalAdressLength) |
|
|
|
{ |
|
|
|
validCity = false; |
|
|
|
} |
|
|
@ -105,13 +102,7 @@ bool isValidAdress(char *street,char* city,int houseNumber,int postalCode) |
|
|
|
{ |
|
|
|
validpostalCode = false; |
|
|
|
} |
|
|
|
if(validStreet==true && validCity==true && validHouseNumber==true && validpostalCode==true) |
|
|
|
{ |
|
|
|
return true; |
|
|
|
} |
|
|
|
{ |
|
|
|
return false; |
|
|
|
} |
|
|
|
return (validStreet && validCity && validHouseNumber && validpostalCode); |
|
|
|
} |
|
|
|
|
|
|
|
int StringLengthCounter(char* string) |
|
|
|