| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 972 人关注过本帖
标题:Question about heap corruption --- see screen plot for details.
只看楼主 加入收藏
HJin
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:401
专家分:0
注 册:2007-6-9
收藏
 问题点数:0 回复次数:4 
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
aipb2007
Rank: 8Rank: 8
来 自:CQU
等 级:贵宾
威 望:40
帖 子:2879
专家分:7
注 册:2007-3-18
收藏
得分:0 
不懂,HJin大哥把你代码弄出来,让我们好研究研究。

(*_*)

Fight  to win  or  die...
2007-07-05 20:53
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
aipb2007
Rank: 8Rank: 8
来 自:CQU
等 级:贵宾
威 望:40
帖 子:2879
专家分:7
注 册:2007-3-18
收藏
得分:0 
呵呵,20个,这么多啊!
那你加油吧!!!

》_《

Fight  to win  or  die...
2007-07-05 21:45
野比
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:24
帖 子:1627
专家分:516
注 册:2007-5-24
收藏
得分:0 
哈... HJin开始弄你的BigNumber拉... 不是做1000!吗?... 变拉?

女侠,约吗?
2007-07-05 22:06
快速回复:Question about heap corruption --- see screen plot for details.
数据加载中...
 
   



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

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