|
|
@ -7,8 +7,8 @@ |
|
|
|
char data[1000]; |
|
|
|
void deleteWhitespace(char* a, int length); |
|
|
|
op readFunction(char* data, int length); |
|
|
|
char* getnumbers(char* data, int length, calc_op* structure_ref); |
|
|
|
void printstruct(calc_op* formula); |
|
|
|
char* getNumbers(char* data, int length, calc_op* structure_ref); |
|
|
|
void showStruct(calc_op* formula); |
|
|
|
|
|
|
|
|
|
|
|
void input(char* a, int length) { |
|
|
@ -17,8 +17,8 @@ void input(char* a, int length) { |
|
|
|
memcpy(data,a,length); |
|
|
|
temp.formel = a; |
|
|
|
temp.funktionstyp = readFunction(data, 10); |
|
|
|
if (getnumbers(data,length, &temp) == NULL){ |
|
|
|
printstruct(&temp); |
|
|
|
if (getNumbers(data, length, &temp) == NULL){ |
|
|
|
showStruct(&temp); |
|
|
|
} else { |
|
|
|
printf("Formular %s not supported", temp.formel); |
|
|
|
} |
|
|
@ -51,7 +51,7 @@ op readFunction(char* data, int length){ |
|
|
|
} |
|
|
|
|
|
|
|
//Zahlen auslesen (+) |
|
|
|
char* getnumbers(char* data, int length, calc_op* structure_ref){ //input sind: string, länge vom String, berechnungsstruct |
|
|
|
char* getNumbers(char* data, int length, calc_op* structure_ref){ //input sind: string, länge vom String, berechnungsstruct |
|
|
|
// char tmp[length]; |
|
|
|
char* splitPnt; |
|
|
|
int i = 0; |
|
|
@ -88,7 +88,7 @@ char* getnumbers(char* data, int length, calc_op* structure_ref){ //input sind: |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void printstruct(calc_op* formula){ |
|
|
|
void showStruct(calc_op* formula){ |
|
|
|
printf("Berechnung: %s\n", formula->formel); |
|
|
|
switch (formula->funktionstyp) { |
|
|
|
case opAdd: |
|
|
|