größerer int

This commit is contained in:
f0tt3r 2026-06-08 21:09:41 +02:00
parent ca14ee97e4
commit 614fa462d8

View file

@ -10,7 +10,7 @@
void hallo_welt(void) { printf(HALLO); } void hallo_welt(void) { printf(HALLO); }
// use more then one int type // use more then one int type
const char *binaerzahl(uint8_t bin) { const char *binaerzahl(uint32_t bin) {
char *str = malloc(sizeof(bin) * 8 + char *str = malloc(sizeof(bin) * 8 +
1); // Allocate 8 bits for actual data and 1 Bit for the \0 1); // Allocate 8 bits for actual data and 1 Bit for the \0
// sign indicating the end of the string // sign indicating the end of the string
@ -27,8 +27,8 @@ const char *binaerzahl(uint8_t bin) {
} }
int getint(void) { int getint(void) {
uint8_t i; uint32_t i;
scanf("%hhu", &i); scanf("%u", &i);
return i; return i;
} }