Browse Source

refactoring: renamed function calLen() to calculateStringLength and inner variables in order to increase readability. Now it is easier to understand.

remotes/origin/development
fdai7057 2 years ago
parent
commit
0a3e444766
  1. 8
      src/helperFunctions.c
  2. 2
      src/helperFunctions.h

8
src/helperFunctions.c

@ -142,10 +142,10 @@ double balanceToDouble(char *balanceAsString)
return sign * result / power; return sign * result / power;
} }
unsigned int calLen(char *str){
int len = 0;
while(*(str+len)!='\0') ++len;
return len;
unsigned int calculateStringLength(char *string){
int length = 0;
while(*(string+length)!='\0') ++length;
return length;
} }
bool characterIsUpperCase(char inputCharacter) bool characterIsUpperCase(char inputCharacter)

2
src/helperFunctions.h

@ -13,6 +13,6 @@ unsigned int power(unsigned int, unsigned int);
bool everyCharacterIsDigit(char *); bool everyCharacterIsDigit(char *);
bool isLetterOfAlphabet(char *); bool isLetterOfAlphabet(char *);
double balanceToDouble(char *); double balanceToDouble(char *);
unsigned int calLen();
unsigned int calculateStringLength(char *);
bool charIsUpperCase(char ); bool charIsUpperCase(char );
#endif #endif
Loading…
Cancel
Save