What is the difference between *ptr and ptr as they are giving same output??
Need of brief difference between *ptr and ptr
@Anubhav-Gupta-1124473791053680 hey basically ptr is pointer which hold the adress of variable and when you print ptr it will print some hexadecimal adress ,whereas *ptr is the value which is stored at adress which is stored by ptr. Take example
int a=5;
int * ptr=&a;
print ptr and * ptr you will see ptr print adress whereas *ptr print 5.
Hope you get it.
1 Like
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.