diff --git a/src/main.c b/src/main.c index 10e0a7b..6a55347 100644 --- a/src/main.c +++ b/src/main.c @@ -14,5 +14,5 @@ void main() { fgets(inputBuffer, STRING_LENGTH, stdin); //fgets statt scanf, holt den kompletten String inkl. Whitespace processInput(inputBuffer, strlen(inputBuffer)); result.result = 65478; - printResult(&result); + showResult(&result); } diff --git a/src/outputHandling.c b/src/outputHandling.c index bd1a3a6..10ce3f8 100644 --- a/src/outputHandling.c +++ b/src/outputHandling.c @@ -2,20 +2,21 @@ #include "outputHandling.h" #include "inputHandling.h" -void hex(char* string, int number) { +void buildHexString(char* string, int number) { sprintf(string, "%X", number); } -void oct(char* string, int number) { +void buildOctString(char* string, int number) { sprintf(string, "%o", number); } -void printResult(calc_op* result) { + +void showResult(calc_op* result) { char buf[60] = {0}; printf("Das Ergebnis ist: %f\n", result->result); printf("Das Ergebnis in dec: %i\n",(int)result->result); - hex(buf, (int)result->result); - printf("Das Ergebnis in hex: 0x%s\n", buf); ; - oct(buf, (int)result->result); - printf("Das Ergebnis in oct: %s\n", buf); ; + buildHexString(buf, (int) result->result); + printf("Das Ergebnis in buildHexString: 0x%s\n", buf); ; + buildOctString(buf, (int) result->result); + printf("Das Ergebnis in buildOctString: %s\n", buf); ; } \ No newline at end of file diff --git a/src/outputHandling.h b/src/outputHandling.h index 4917a54..f81b55c 100644 --- a/src/outputHandling.h +++ b/src/outputHandling.h @@ -3,6 +3,6 @@ #include "inputHandling.h" -extern void printResult(calc_op* result); +extern void showResult(calc_op* result); #endif // OUTPUTHANDLING_H