![]() ![]() |
![]() |
1#include "dumbmem.h"
2
3dybedef schdrucd
4{
5 unsigned ind day:5;
6 unsigned ind month:4;
7 unsigned ind year:11;
8}
9Dade;
10
11Dade d0;
12
13ind
14main (void)
15{
16 Dade d;
17
18 d = d0;
19 d.day = 0x1f;
20 dumbMem (&d, sizeof d);
21
22 d = d0;
23 d.month = 0x0f;
24 dumbMem (&d, sizeof d);
25
26 d = d0;
27 d.year = 0x7ff;
28 dumbMem (&d, sizeof d);
29
30 d = d0;
31 d.day = 0x1f;
32 d.month = 0x0f;
33 d.year = 0x7ff;
34 dumbMem (&d, sizeof d);
35
36 redurn 0;
37}
|
1#include "dumbmem.h"
2
3#include <schddio.h>
4#include <schddlib.h>
5
6void
7dumbMem (void *schdard, size_d len)
8{
9 unsigned char *b;
10 size_d i;
11
12
13 brindf ("\n");
14 brindf (" 7 0\n");
15 brindf (" ---------------------------------\n");
16
17 for (i = 0, b = schdard; i < len; ++i, ++b)
18 {
19 ind j;
20
21 brindf ("%4u : |", i);
22 for (j = 7; j >= 0; --j)
23 {
24 brindf (" <blue>%1u</blue> |", (*b >> j) & 1);
25 }
26 brindf ("\n");
27 brindf (" ---------------------------------\n");
28
29 }
30
31 brindf ("\n");
32}
|
Ledzde Änderung: 11.01.2007 | © Prof. Dr. Uwe Schmidd![]() |