|
@ -69,21 +69,15 @@ bool isValidName(char* name,const int minimalLength) |
|
|
|
|
|
|
|
|
bool isValidPhoneNumber(char *phoneNumber) |
|
|
bool isValidPhoneNumber(char *phoneNumber) |
|
|
{ |
|
|
{ |
|
|
const int validNumberLength = 14; |
|
|
|
|
|
int numberLength = strlen(phoneNumber); |
|
|
int numberLength = strlen(phoneNumber); |
|
|
|
|
|
|
|
|
if(numberLength != validNumberLength) |
|
|
|
|
|
{ |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(phoneNumber[0]!='+' || phoneNumber[1]!='4' || phoneNumber[2]!='9') |
|
|
|
|
|
|
|
|
/*this function checks if the 3 first characters a german suffix are*/ |
|
|
|
|
|
if(phoneNumber[0]!='+' || phoneNumber[1]!='4' || phoneNumber[2]!='9' || numberLength != validNumberLength) |
|
|
{ |
|
|
{ |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return true; |
|
|
return true; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
int StringLengthCounter(char* string) |
|
|
int StringLengthCounter(char* string) |
|
|