Accessing the variable pointed to
void main()
{int var1 = 22;
int* ptr;
ptr = &var1;
cout <<endl <<*ptr;
}
ptr holds the address of var1
*ptr holds the contents of var1
Previous slide
Next slide
Back to first slide
View graphic version