I am having the following problem: I have written a console application that needs to allocate memory. I am now debugging the program. I do not have any problems the first time I debug. Bu then, when I find an error or the program crashes and the debugging terminates, I can no longer debug because when I start the program again, it crashes at the first memory allocation instruction. I have to restart my computer to be able to debug the program again!! I imagine that this happens because as the program did not terminate correctly, the deallocation instructions were not reached, so the memory stays allocated. I have never had this problem with the other versions of Visual Studio I have used. Or could this be because of Vista? Could someone help me, please? Thanks!!
joanam
0
Newbie Poster
Recommended Answers
Jump to PostAre you sure you stopped debugging correctly? Not paused or something?
What debugger are you using?
Perhaps you can show some code
Jump to PostAs what is TEMP defined?
custos=new arco[(TEMP+1)^2];
Do you realise that '^' means XOR and not 'to the power' ?What debugger are you using?
Also please read this about code tags before posting your code again
[edit] Whoohoo 1000 posts for me :)
Jump to PostYou are running in memory that isn't yours.
Let's say that TEMP = 200; Then this linecustos=new arco[(TEMP+1)*20];
will create (200+1)*20 = 4020arco'sBut then you do :
for(int t=1;t<=TEMP;t++) { for (int t1=t+1;t1<=TEMP+1;t1++) { custos[arcos_total].a=t; custos[arcos_total].b=t1; custos[arcos_total].custos=FLT_MAX; arcos_total++; } }
Which will result …
All 11 Replies
Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster
joanam
0
Newbie Poster
Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster
joanam
0
Newbie Poster
Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster
joanam
0
Newbie Poster
Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster
joanam
0
Newbie Poster
eng16danbo
0
Newbie Poster
Nick Evan
4,005
Industrious Poster
Team Colleague
Featured Poster
eng16danbo
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.