日期:2014-05-19  浏览次数:20740 次

问一个数组+堆,栈问题
class   class1

void   sf()
{

string[]   x   =new   string[]{ "sfds ", "fsdf "}

}
请问x存在堆栈中还是堆中,还是堆栈中和堆中都有?

------解决方案--------------------
x在栈中,new int[]{1,2,3}在堆中。
x是一个引用,说白了就是一个表示地址的值。