Beispiel 1: Zeiger

23.01.2017 04:31 Uhr
#include
using namespace std;

int main ()
{
int firstvalue, secondvalue;
int * mypointer;

mypointer = &firstvalue;
*mypointer = 10;
mypointer = &secondvalue;
*mypointer = 20;
cout << "firstvalue is " << firstvalue << '\n';
cout << "secondvalue is " << secondvalue << '\n';
return 0;
}

// Quelle: http://www.cplusplus.com/doc/tutorial/pointers/

Schlagwörter: