| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 974 人关注过本帖
标题:Question about heap corruption --- see screen plot for details.
取消只看楼主 加入收藏
HJin
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:401
专家分:0
注 册:2007-6-9
收藏
 问题点数:0 回复次数:1 
Question about heap corruption --- see screen plot for details.

I was writing my BigInt class to compute 500! The class uses dynamically allocated array as interal data member.

I got an error about "heap", which you can see from the attached .jpg file, although my program does give the correct answer for 500!:


12201368259911100687012387854230469262535743428031928421924135883858453731538819
97605496447502203281863013616477148203584163378722078177200480785205159329285477
90757193933060377296085908627042917454788242491272634430567017327076946106280231
04526442188787894657547771498634943677810376442740338273653974713864778784954384
89595537537990423241061271326984327745715546309977202781014561081188373709531016
35632443298702956389662891165897476957208792692887128178007026517450776841071962
43903943225364226052349458501299185715012487069615681416253590566934238130088562
49246891564126775654481886506593847951775360894005745238940335798476363944905313
06232374906644504882466507594673586207463792518420045936969298102226397195259719
09452178233317569345815085523328207628200234026269078983424517120062077146409794
56116127629145951237229913340169552363850942885592018727433795173014586357570828
35578015873543276888868012039988238470215146760544540766353598417443048012893831
38968816394874696588175045069263653381750554781286400000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000
Press any key to continue . . .


If you could help about the heap problem, I would be very much appreciated.

HJin

图片附件: 游客没有浏览图片的权限,请 登录注册

搜索更多相关主题的帖子: heap corruption plot details Question 
2007-07-05 18:47
HJin
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:401
专家分:0
注 册:2007-6-9
收藏
得分:0 
almost there --- will release soon. I think it would be a very good practice for a beginner (not you) to learn operator overloading.

I've overloaded almost 20 operators.


I am working on a system which has no Chinese input. Please don\'t blame me for typing English.
2007-07-05 21:18
快速回复:Question about heap corruption --- see screen plot for details.
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.031512 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved