36 lines
524 B
C
36 lines
524 B
C
|
/*
|
||
|
tp-local.c: TecPro Beispielprogramm
|
||
|
Kurzbeschreibung: lokale Datenobjekte / Gültigkeit
|
||
|
C.Koch | HS-Emden-Leer | 25.11.2010
|
||
|
*/
|
||
|
|
||
|
|
||
|
#include <stdio.h>
|
||
|
|
||
|
void main(void)
|
||
|
{
|
||
|
int myObj;
|
||
|
int* myObjPtr;
|
||
|
|
||
|
myObj = 20;
|
||
|
myObjPtr = &myObj;
|
||
|
|
||
|
/* Zugriff auf beliebige Adressen - was passiert?*/
|
||
|
/* myObjPtr = (int*) 0x55555; */
|
||
|
|
||
|
*myObjPtr = 10;
|
||
|
|
||
|
printf("->> Wert myObj \t: %i", myObj);
|
||
|
|
||
|
int a = 5;
|
||
|
|
||
|
{
|
||
|
int a = 20;
|
||
|
|
||
|
a++;
|
||
|
}
|
||
|
|
||
|
/* Welcher Wert wird ausgegeben - 5 oder 20 oder ... ?*/
|
||
|
printf("\n->> Wert a \t: %d\n",a);
|
||
|
}
|