Pointer Example, Swap two values with pointer
char c1 = 'A';
char c2 = 'Z';
char temp, *p;
p = &c1;
temp = *p;
*p = c2;
c2 = temp;
c1 c2 temp p
A
Z
10 11 12 100
p
10
c1 c2 temp
A
Z
A
Z
Z
A
Z
A
A
c1 c2 temp
Previous slide
Next slide
Back to first slide
View graphic version