applying NLP, call it address arithmetic. 'pointers' are feared and misunderstood mostly because they are taught by the wrong people and/or at the wrong stage with wrong examples in the wrong way. It is no wonder that nobody 'gets' it.
when teaching pointers, the faculty goes on about "p is a pointer to a, the value of p is the address of a" and so on. it just wont work. here is the raw material for you to build with. practice with it and your students will get it.
'int a', a is an integer, it stores integer type values.
'int* p', p is an 'int star', it stores 'int star' type values.
'a' is how you get the 'what' integer stored in a (try not to use 'value of a')
'&a' is how you get the 'where' a itself is stored (try to say 'address')
'b = a' for this to work, both sides must be of the same type. if a is int, b must be capable of storing an int. (so ______ b, the blank is filled with 'int')
'p = &a' for this to work, both sides must be of the same type. if a is an integer, &a is an address, p must be capable of storing addresses of integers. (so ______ p, the blank is filled with 'int *')
now write int *p differently to bring out the type information:
int* | p
what is 'p'? ans: it is 'int *'. so 'p' is an address of an integer.
int | *p
what is '*p'? ans: it is an 'int'. so '*p' is an integer.
now on to the address arithmetic:
int a;
a=1;
a=a+1;
what are we doing in 'a=a+1'? think of it as 'next'. Because a is a number, this is like saying 'next number'. Since a holds 1, saying 'next' will make it 2.
// fallacious example. you have been warned!!!
int *p
int a;
p = &a;
p=p+1;
what are we doing in 'p=p+1'? it is still saying 'next'. This time, p is not a number but an address. So what we are saying is 'next address'. Next address depends on the data type, more specifically on the size of the data type.
printf("%d %d %d", sizeof(char), sizeof(int), sizeof(float));
so 'next' for an address will move forward sizeof(data type).
this has worked for me and all of the people I used to teach.