|
|
@ -25,13 +25,12 @@ void input() { |
|
|
|
} else { |
|
|
|
printf("Formular %s not supported", temp.formel); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//Leerzeichen löschen |
|
|
|
void deleteWhitespace(){ |
|
|
|
for(int i=0; i<STRINGL; i++){ |
|
|
|
if(a[i]==' '){ |
|
|
|
if((a[i]==' ')||(a[i]=='\n')||(a[i]=='\r')){ |
|
|
|
for (int j=i; j<STRINGL; j++){ |
|
|
|
a[j]=a[j+1]; |
|
|
|
} |
|
|
@ -48,6 +47,7 @@ op readFunction(char* data, int length){ |
|
|
|
case '/': return opDiv; |
|
|
|
case '*': return opMult; |
|
|
|
case '^': return opExp; |
|
|
|
case '\0': return opEmpty; |
|
|
|
} |
|
|
|
} |
|
|
|
return opNotSupported; |
|
|
@ -83,10 +83,10 @@ char* getnumbers(char* data, int length, calc_op* structure_ref){ //input sind: |
|
|
|
token = strtok(NULL, "+"); //Sucht von der letzten Plus-Stelle an weiter |
|
|
|
} |
|
|
|
structure_ref->arraylength=i; //Länge des Arrays (also zu berechnende Zahlen) gespeichert |
|
|
|
if (readFunction(splitPnt, strlen(splitPnt)!=opNotSupported)){ |
|
|
|
return splitPnt; |
|
|
|
} else { |
|
|
|
if (readFunction(splitPnt, strlen(splitPnt)+1)!=opNotSupported){ |
|
|
|
return NULL; |
|
|
|
} else { |
|
|
|
return splitPnt; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|