@ -1,4 +1,4 @@
# include "stringManipulation .h"
# include "helperFunctions .h"
/*Code written by Julius Philipp Engel, fdai7057*/
/*Code written by Julius Philipp Engel, fdai7057*/
char * stringConcatenation ( char * string_1 , char * string_2 )
char * stringConcatenation ( char * string_1 , char * string_2 )
@ -116,3 +116,24 @@ char *generateCheckString(unsigned int customerID, char *customerPassword)
* ( checkString + checkStringLength ) = ' \0 ' ;
* ( checkString + checkStringLength ) = ' \0 ' ;
return checkString ;
return checkString ;
}
}
double stod ( char * s )
{
double result , power ;
int i = 0 , sign ;
sign = ( * ( s ) = = ' - ' ) ? - 1 : 1 ;
if ( * ( s ) = = ' + ' | | * ( s ) = = ' - ' ) {
+ + i ;
}
for ( result = 0.0 ; * ( s + i ) ! = ' . ' ; + + i ) {
result = 10.0 * result + ( * ( s + i ) - ' 0 ' ) ;
}
if ( * ( s + i ) = = ' . ' ) {
+ + i ;
}
for ( power = 1.0 ; * ( s + i ) ! = ' \0 ' ; + + i ) {
result = 10.0 * result + ( * ( s + i ) - ' 0 ' ) ;
power * = 10.0 ;
}
return sign * result / power ;
}