|
|
@ -4,7 +4,7 @@ |
|
|
|
#include <stdlib.h> |
|
|
|
|
|
|
|
|
|
|
|
char data[1000]; |
|
|
|
char formulaBuffer[1000]; |
|
|
|
void deleteWhitespace(char* formulaString, int length); |
|
|
|
op readFunction(char* formulaString, int length); |
|
|
|
char* getNumbers(char* formulaString, int length, calc_op* formulaRef); |
|
|
@ -14,10 +14,10 @@ void showStruct(calc_op* formulaRef); |
|
|
|
void input(char* formulaString, int length) { |
|
|
|
deleteWhitespace(formulaString, length); |
|
|
|
calc_op temp; |
|
|
|
memcpy(data, formulaString, length); |
|
|
|
memcpy(formulaBuffer, formulaString, length); |
|
|
|
temp.formel = formulaString; |
|
|
|
temp.funktionstyp = readFunction(data, 10); |
|
|
|
if (getNumbers(data, length, &temp) == NULL){ |
|
|
|
temp.funktionstyp = readFunction(formulaBuffer, 10); |
|
|
|
if (getNumbers(formulaBuffer, length, &temp) == NULL){ |
|
|
|
showStruct(&temp); |
|
|
|
} else { |
|
|
|
printf("Formular %s not supported", temp.formel); |
|
|
|