Here is my program
int* fun1(void)
{
int n=9;
int *pf=&n;
cout<<*pf<<endl;
return pf;
}
int main(int argc, char *argv[])
{
int *p=fun1();
cout<<*p;
return 0;
}
Compilation and running of program doesn't give any problems but with valgrind it gives message/warning "Invalid read of size 4".
Any help to resolve the warning is most welcome