You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
627 B

11 months ago
  1. #include <stdio.h>
  2. #include "outputHandling.h"
  3. #include "inputHandling.h"
  4. void buildHexString(char* string, int num) {
  5. sprintf(string, "0x%X", num);
  6. }
  7. void buildOctString(char* string, int num) {
  8. sprintf(string, "%o", num);
  9. }
  10. void showResult(calc_op* res) {
  11. char string[60] = {0};
  12. printf("Das Ergebnis ist: %f\n", res->result);
  13. printf("Das Ergebnis in dec: %i\n",(int)res->result);
  14. buildHexString(string, (int) res->result);
  15. printf("Das Ergebnis in buildHexString: 0x%s\n", string); ;
  16. buildOctString(string, (int) res->result);
  17. printf("Das Ergebnis in buildOctString: %s\n", string); ;
  18. }