Systemnahe Programmierung in C: Zeigerarithmetik |
|
1int ar[] = { 1, 3, 5, 7 };
2
3void
4niceTry (void)
5{
6
7 int *p1 = &ar[0];
8 int *p2 = ar;
9
10 int j;
11
12 char *p3;
13
14 p2 = p1 + 3;
15 j = p2 - p1;
16 j = p1 - p2;
17 p1 = p2 - 1;
18
19 p1 = p1 + 2;
20 p3 = p1 - 1;
21 j = p1 - p3;
22
23 p1 = 0;
24
25 while (p1)
26 ;
27
28 while (p1 != 0)
29 ;
30}
|
Letzte Änderung: 11.01.2007 | © Prof. Dr. Uwe Schmidt |