#include <stdio.h>
int *changeAddress(){
int c=23;
int *ptr= &c;
printf("Inside function Address of Pointer is %p\n",ptr);
printf("Inside function Value of of Pointer is %d\n",*ptr);
return (ptr);
}
int main(void){
int *b=changeAddress();
printf("Inside main Address of Pointer is %p\n",b);
printf("Inside main Value of of Pointer is %d\n",*b);
return 0;
}
//In the above program i am trying to access the value of local variable c and pass it to the main function and trying to get back the value of c variable in the main function.