RUSES
Would you like to react to this message? Create an account in a few clicks or log in to continue.
May 2024
MonTueWedThuFriSatSun
  12345
6789101112
13141516171819
20212223242526
2728293031  

Calendar Calendar


"Debug Assertion Failed" HELP?

4 posters

Go down

"Debug Assertion Failed" HELP? Empty "Debug Assertion Failed" HELP?

Post  VicVic Wed Feb 29, 2012 1:30 am

"Debug Assertion Failed" HELP? Errors10

Anyone got any ideas as to how I can fix this? I tried running it in debug, and it opens up a source file called mlock.c which I think is part of Visual C++

VicVic

Posts : 17
Join date : 2012-02-28

Back to top Go down

"Debug Assertion Failed" HELP? Empty Re: "Debug Assertion Failed" HELP?

Post  Alex Wed Feb 29, 2012 1:35 am

Need to see the code - I'm pretty sure it's caused when invalid memory is accessed
Alex
Alex

Posts : 67
Join date : 2012-02-23
Location : Come at me bro

Back to top Go down

"Debug Assertion Failed" HELP? Empty Re: "Debug Assertion Failed" HELP?

Post  VicVic Wed Feb 29, 2012 1:36 am


Here's the program in full - there's a chunk commented out where I was trying and failing to sort zero and negative zero, but otherwise everything in there appears functional.... even if it is horribly inefficient...


Last edited by VicVic on Wed Feb 29, 2012 4:19 am; edited 1 time in total

VicVic

Posts : 17
Join date : 2012-02-28

Back to top Go down

"Debug Assertion Failed" HELP? Empty Re: "Debug Assertion Failed" HELP?

Post  John Wed Feb 29, 2012 2:44 am

i beleve u are using two different functions for timing!
i would suggest replacing ur timers with

Code:
float timer;
clock_t a = clock();



              *code*

a = clock() - a;

that gives u number of clock ticks

u can then use function
say

Code:
timer = a/CLOCKS_PER_SEC;


Last edited by John on Wed Feb 29, 2012 7:00 am; edited 1 time in total
John
John
Admin

Posts : 36
Join date : 2012-02-23
Age : 32

https://ruses.forumotion.co.uk

Back to top Go down

"Debug Assertion Failed" HELP? Empty Re: "Debug Assertion Failed" HELP?

Post  VicVic Wed Feb 29, 2012 4:18 am

Turns out it was due to the fact that I'd try to free up the array at the end (at the advice of a friend), despite not using malloc to create a dynamic array.
Problem solved =)

VicVic

Posts : 17
Join date : 2012-02-28

Back to top Go down

"Debug Assertion Failed" HELP? Empty Re: "Debug Assertion Failed" HELP?

Post  daveclarke Wed Feb 29, 2012 7:33 am

VicVic wrote:Turns out it was due to the fact that I'd try to free up the array at the end (at the advice of a friend), despite not using malloc to create a dynamic array.
Problem solved =)

If your using C++ you shouldn't be using malloc anyway, use new and delete[]. Read here for more info on dynamic memory.

daveclarke

Posts : 8
Join date : 2012-02-24

Back to top Go down

"Debug Assertion Failed" HELP? Empty Re: "Debug Assertion Failed" HELP?

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum