Browse Source

Implementation of function calLen().

remotes/origin/development
fdai7057 2 years ago
parent
commit
68e5650300
  1. 10
      src/helperFunctions.c
  2. 1
      src/helperFunctions.h

10
src/helperFunctions.c

@ -1,6 +1,10 @@
#include "helperFunctions.h" #include "helperFunctions.h"
/*Code written by Julius Philipp Engel, fdai7057*/ /*Code written by Julius Philipp Engel, fdai7057*/
int main(){
}
char *stringConcatenation(char *string_1, char *string_2) char *stringConcatenation(char *string_1, char *string_2)
{ {
int lengthStringOne = strlen(string_1); int lengthStringOne = strlen(string_1);
@ -138,6 +142,12 @@ 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;
}
bool characterIsUpperCase(char inputCharacter) bool characterIsUpperCase(char inputCharacter)
{ {
bool result = (inputCharacter>='A'&&inputCharacter<='Z') ? true : false; bool result = (inputCharacter>='A'&&inputCharacter<='Z') ? true : false;

1
src/helperFunctions.h

@ -13,5 +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();
bool charIsUpperCase(char ); bool charIsUpperCase(char );
#endif #endif
Loading…
Cancel
Save