此程序为什么得不到期望值20和4435500??大神们,求分析?????????
#include<iostream.h>int * getInt(char * str)
{
int value=20;c
cout<<str<<endl;
return &value;
}
void somefn(char * str)
{
int a=40;
cout<<str<<endl;
}
int main()
{
int * pr=getInt("input a value:");
cout<<* pr<<endl;
somefn("It is uncertain.");
cout<<* pr<<endl;
}