#include <stdio.h>
int main()
{
int x=10;
int *p=&x;
foo(&p);
printf("%d ",*p);
printf("%d ",*p);
}
void foo(int** l)
{
int j=20;
*l=&j;
printf("%d ",**l);
}
can you explain why the output is [20 20 garbage] ? why cant i get 20 20 20? Both the statements of print after the foo function call are same.