在巨大的解决方案中向类中添加成员时出现堆栈溢出错误
请看一下这段代码:
class A
{
int a;
};
然后再向 A 类添加一个成员:
class A
{
int a;
int b;
};
在我的庞大解决方案中,当我向一个类中再添加一个成员(如 A 类中的成员 b)时,我会收到堆栈溢出错误。我认为这在某种程度上与写入未保留的数据地址有关。
Visual Studio中有没有办法找到这样的地方?为什么会发生这种错误,有更好的想法吗?
Please look at this code:
class A
{
int a;
};
Then add one more member to class A:
class A
{
int a;
int b;
};
In my huge solution when I add one more member to a class (like member b in class A) I get stack overflow error. I assume that this is somehow related to writing to not reserved data adresses.
Is there any way to find such places in visual studio? Any better ideas why such kind of error happens?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,第一个问题:你真的添加了一个
int
吗?如果是,那么这个答案适用。在以下情况下可能会发生这种情况:
我建议您首先向我们提供一些更相关的信息(平台、编译器、真实代码/类定义)。
Well, first question: Are you really adding an
int
? If yes, then this answer is applicable.This can happen when:
I would suggest you supply us with some more relevant information (platform, compiler, real code/class definition) first.