问一个数组+堆,栈问题
class class1
void sf()
{
string[] x =new string[]{ "sfds ", "fsdf "}
}
请问x存在堆栈中还是堆中,还是堆栈中和堆中都有?
[解决办法]
x在栈中,new int[]{1,2,3}在堆中。
x是一个引用,说白了就是一个表示地址的值。
发布时间: 2012-04-11 17:42:33 作者: rapoo
问一个数组+堆,栈问题
class class1
void sf()
{
string[] x =new string[]{ "sfds ", "fsdf "}
}
请问x存在堆栈中还是堆中,还是堆栈中和堆中都有?
[解决办法]
x在栈中,new int[]{1,2,3}在堆中。
x是一个引用,说白了就是一个表示地址的值。