Browse Source

Add hex String

remotes/origin/Input_Handling
Sophia Weber 11 months ago
parent
commit
e60128b83b
  1. 9
      src/outputHandling.c

9
src/outputHandling.c

@ -2,7 +2,14 @@
#include "outputHandling.h"
#include "inputHandling.h"
void hex(char* string, int number) {
sprintf(string, "%X", number);
}
void printResult(calc_op* result) {
printf("Das Ergebnis ist: %f", result->result);
char buf[60] = {0};
printf("Das Ergebnis ist: %f\n", result->result);
printf("Das Ergebnis in int: %i\n",(int)result->result);
hex(buf, (int)result->result);
printf("Das Ergebnis in hex: 0x%s\n", buf); ;
}
Loading…
Cancel
Save