Hardwarenahe_Programmierung/examples/c/tp-pvec.c

23 lines
476 B
C
Raw Normal View History

2018-09-26 21:54:09 +02:00
/*
tp-pvec.c: TecPro Beispielprogramm
Kurzbeschreibung: Zeiger und Vektoren
D.Ertelt, C.Koch | HS-Emden-Leer | 25.11.2010
*/
#include <stdio.h>
int main(void) {
unsigned int a[6], i, *aPtr;
printf("Vorher: aPtr = 0x%08x &a = 0x%08x\n", aPtr, &a);
for(i=0; i < 6; i++)
printf("a[%d] = %d\n", i, a[i]);
printf("Nachher: aPtr = 0x%08x\n", (aPtr = a));
for( ; aPtr < a + 6 ; aPtr++) {
*aPtr = i--;
printf("*(0x%08x) = %d\n", (aPtr), *aPtr); }
}