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.
22 lines
627 B
22 lines
627 B
#include <stdio.h>
|
|
#include "outputHandling.h"
|
|
#include "inputHandling.h"
|
|
|
|
void buildHexString(char* string, int num) {
|
|
sprintf(string, "0x%X", num);
|
|
}
|
|
|
|
void buildOctString(char* string, int num) {
|
|
sprintf(string, "%o", num);
|
|
}
|
|
|
|
|
|
void showResult(calc_op* res) {
|
|
char string[60] = {0};
|
|
printf("Das Ergebnis ist: %f\n", res->result);
|
|
printf("Das Ergebnis in dec: %i\n",(int)res->result);
|
|
buildHexString(string, (int) res->result);
|
|
printf("Das Ergebnis in buildHexString: 0x%s\n", string); ;
|
|
buildOctString(string, (int) res->result);
|
|
printf("Das Ergebnis in buildOctString: %s\n", string); ;
|
|
}
|