字符串数组和指针的疑惑解决方法

字符串数组和指针的疑惑
问题1:return语句不能返回指向堆栈内存的指针或引用,所以下面fun1有问题,我能理解。可是为什么换成int*就没有问题了(如fun5)?
char* fun1()
{
  char str[] = "hello";
  return str;
}

int* fun5()
{
  int arr[] = {100, 200};
  return arr;
}
调用:
  int *p = fun5();
  cout << *p << endl;
调试显示 p 的值就是 arr 的地址。

问题2:如果把fun1换成下面形式
const char* fun2()
{
  const char str[] = "hello";
  cout << sizeof(str) << endl;
  cout << strlen(str) << endl;
  return str;
}
const 类型数据存放在程序的静态存储区,为什么结果和fun1一样,外部调用依旧是个不可预测的内容。

------解决方案--------------------
地址值返回是不会有问题的,但是指向的那块内存已经被回收了
------解决方案--------------------
呵呵,简单,在
C/C++ code
    int *p = fun5(); 
    cout  < < *p  < < endl;

------解决方案--------------------
别用VC
别用VC试试看
VC好像很傻,每次都是用同一块区域,结果都看不到错误