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