I have just learned how to use the point, and very confused about why we need to use it. let me bring up an example:
#include <stdio.h>
int main(){
int a,b,*ptr;
a = 2;
ptr = &a;
*ptr = a;
b = *ptr // why not we assign the value of a to b directly (b = a;)
return (0);
}
above is one of example I saw on the video tutorial, I have not had any experience of using pointer. therefore I wonder why do we need it, can anyone show me the use of pointer? thank you