I am unable to understand that why is there change in address output on the screen(30:30) when the instructor changed the typecasting type from (void*)&ch to (int*)&ch. please explain.
Why there is change in address of &ch when it is typecasted from void* to int*?
Hello @Divya_321,
If you continue watching the video, at 30:38 Sir has explained the reason i.e.,
At every run of the program, the variable gets a new address in the memory.
Reason:
Every time you run the program,
The compiler picks a free location randomly in the memory and assigns it to the variable ch.
Hope, this would help.
Give a like, if you are satisfied.
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.