[11]关于STRUCT的存储问题

seakingii 2002-12-31 08:44:06
STRUCT是存在堆上的吧?
那如果STRUCT里有一个CLASS呢?
或者CLASS里有一个STRUCT,那这个STRUCT存在哪里?
...全文
32 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
seakingii 2002-12-31
  • 打赏
  • 举报
回复
小海?你说什么啊
xhan2000 2002-12-31
  • 打赏
  • 举报
回复
struct传值
seakingii 2002-12-31
  • 打赏
  • 举报
回复
>>>那如果STRUCT里有一个CLASS呢?
the object is on the heap, but the variable itself is on the stack

那STRUCT里存着一个指针?

还有,第一句我看不懂,惭愧
saucer 2002-12-31
  • 打赏
  • 举报
回复
>>>STRUCT是存在堆上的吧?
a struct is normally allocated on the stack or wherever its parent is

>>>那如果STRUCT里有一个CLASS呢?
the object is on the heap, but the variable itself is on the stack

>>>CLASS里有一个STRUCT,那这个STRUCT存在哪里?
struct is part of the class, it is on the heap

111,125

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧