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