Skip to content
Snippets Groups Projects
Commit 32464b0a authored by Peter Gerwinski's avatar Peter Gerwinski
Browse files

Musterlösungen zu Übungsaufgaben

parent 28524368
No related branches found
No related tags found
No related merge requests found
#include <stdio.h>
#include <stdint.h>
int main (void)
{
uint32_t x = 303108111;
char *s = &x;
printf ("%s\n", s);
return 0;
}
#include <stdio.h>
#include <stdint.h>
int main (void)
{
uint64_t x = 4262939000843297096;
char *s = &x;
printf ("%s\n", s);
return 0;
}
#include <stdio.h>
#include <stdint.h>
uint8_t repair (uint8_t data)
{
uint8_t new_data = 0;
for (int i = 0; i < 8; i++)
if ((data >> i) % 2)
new_data |= 1 << (7 - i);
return new_data;
}
int main (void)
{
printf ("%3d %3d\n", 94, repair (94));
printf ("%3d %3d\n", 47, repair (47));
printf ("%3d %3d\n", 30, repair (30));
printf ("%3d %3d\n", 24, repair (24));
printf ("%3d %3d\n", 21, repair (21));
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment