Lecture 7_Pointer
Lecture 7_Pointer
a = a+1
Declaring pointer variables
type * variable_name;
it is not enough to say that a variable is a pointer. You also have
to specify the type of variable to which the pointer points !
int * p1; // p1 points to an integer
float * p2; // p2 points to a float
#include <stdio.h>
there is no direct way for the called function to alter a variable in the calling
function.
Any operation that can be achieved by array subscripting can also be done with pointers
int a[10];
int *pa;
pa=&a[0];
Or
pa=a;
pa=a; a=pa;
pa++; a++;