Please find the code snippet as shown below:
#include
int My_func(int **);
int main()
{
int a =5;
int *p = &a;
My_Fu
You are assigning the address of local variable, which will soon disappear when My_Func returns. You can use following in your code. However you can do the same thing just by using single pointer, double pointer is not required in this example.
void My_Func(int **p)
{
int val = 100;
int *Ptr = &val;
**p = *Ptr;
}