what is the difference between pointer , reference and dereference in c?
A pointer's value is a memory address.
int a;
int* b = &a;
// b holds the memory address of a, not the value of a.
A reference is a pointer with a value (memory address) that refers to a desired item.
int a;
int* b = &a;
// b is a reference to a.
A dereference is a technique of grabbing the memory contents that a pointer references.
int a;
int* b = &a;
int c = *b;
// c dereferences b, meaning that c will be set with the value stored in the address that b contains.
Note that a C++ reference is a different thing than a C reference. A C++ reference is an abstract idea where C++ decides to allow you to use non-pointer syntax for most calls, but will automatically "do the right thing" in passing a pointer when needed.