diff --git a/src/inputHandling.c b/src/inputHandling.c index 58446ad..efa40c9 100644 --- a/src/inputHandling.c +++ b/src/inputHandling.c @@ -16,9 +16,9 @@ void input() { fgets(a, STRINGL, stdin); //fgets statt scanf, holt den kompletten String inkl. Whitespace deleteWhitespace(); calc_op temp; + temp.formel = a; temp.funktionstyp = readFunction(a, 10); getnumbers(a,STRINGL, &temp); - printf("Ihre Berechnung: %s \n", a); printstruct(&temp); } @@ -78,6 +78,7 @@ void getnumbers(char* data, int length, calc_op* structure_ref){ //input sind: s } void printstruct(calc_op* formula){ + printf("Berechnung: %s", formula->formel); switch (formula->funktionstyp) { case opAdd: printf("Rechenoperation: Addition\n"); break; @@ -90,4 +91,9 @@ void printstruct(calc_op* formula){ default: printf("Fehler bei Auswahl der Rechenoperationen \n"); } + printf("Calculation Variables:\n"); + for (int i = 0; i < formula->arraylength; ++i) { + printf("Array[%i] = %f\n", i, formula->array[i]); + } + printf("Result: %f", formula->result); } \ No newline at end of file diff --git a/src/inputHandling.h b/src/inputHandling.h index a2d8614..676b08d 100644 --- a/src/inputHandling.h +++ b/src/inputHandling.h @@ -11,6 +11,7 @@ char* formel; double array[10]; int arraylength; void* child; +void* parent; double result; }calc_op;