首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

问一个数组+堆,栈有关问题

2012-04-11 
问一个数组+堆,栈问题classclass1voidsf(){string[]xnewstring[]{ sfds , fsdf }}请问x存在堆栈中还

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

void   sf()
{

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

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

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

热点排行