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

Beispielprogramme 10.12.2015

parent c9959f10
Branches
No related tags found
No related merge requests found
#include <stdio.h>
int main (void)
{
union
{
int a;
char b[4];
}
foo;
printf ("%d %d %d %d\n", foo.b[0], foo.b[1], foo.b[2], foo.b[3]);
foo.a = 16777216 + 512 + 42;
printf ("%d %d %d %d\n", foo.b[0], foo.b[1], foo.b[2], foo.b[3]);
return 0;
}
#include <stdio.h>
int main (void)
{
union
{
int a;
char c;
}
foo;
printf ("%d\n", foo.c);
foo.a = 16777216 + 512 + 42;
printf ("%d\n", foo.c);
return 0;
}
#include <stdio.h>
int main (void)
{
union
{
int a;
char b[4];
}
foo;
printf ("%d %d %d %d\n", foo.b[0], foo.b[1], foo.b[2], foo.b[3]);
foo.a = 16777316 + 137 + 46;
printf ("%d %d %d %d\n", foo.b[0], foo.b[1], foo.b[2], foo.b[3]);
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment