Some wierd Assertion error (?)

Started by
3 comments, last by Jason2Jason 21 years, 10 months ago
Hi. Can some one tell me what this means: What does this mean? What causes it? How can I fix it? I have no idea what this assertion stuff is. All i can tell you is that when i press ignore, the program performs an illegal op. When in debug, it crashes after a bitmap loading function. If you need a look at that or any other stuff in my code please say. thx, -J [edited by - jason2jason on June 3, 2002 7:50:24 PM] [edited by - jason2jason on June 3, 2002 7:53:54 PM]
Advertisement
Red - X. Write out the error. If it says damage before/after block, do a search on this board as this question is answered often.
Sorry, i got it running off my own pc, ans some1 here turned the inet off! it should be there now
quote:Original post by Jason2Jason
Hi. Can some one tell me what this means:

<img src="http://193.203.245.211/um.JPG">

What does this mean? What causes it? How can I fix it? I have no idea what this assertion stuff is. All i can tell you is that when i press ignore, the program performs an illegal op. When in debug, it crashes after a bitmap loading function. If you need a look at that or any other stuff in my code please say.

thx,

-J

<SPAN CLASS=editedby>[edited by - jason2jason on June 3, 2002 7:50:24 PM]</SPAN>

<SPAN CLASS=editedby>[edited by - jason2jason on June 3, 2002 7:53:54 PM]</SPAN>


Assert is a common macro that can be found in just about any C/C++ implementation. What does it do? Well basically it tosses up a message box if the value is 0. Here is an example:

int value = 0;
assert(value);

Why is this useful? Well many functions in the C library as well as C++ library return 0 if they fail, an example of this would be:

FILE *filepointer;
filepointer = fopen("bitmap.bmp","rb";
assert(filepointer);

If the function can not locate "bitmap.bmp" it will return 0, otherwise it returns a pointer to the file. The assert tells the programmer if the function worked or not.

In all likelyhood the function that''s called before the assert is failing for some reason, you should look into that by stepping through the debugger.


Ok thx. If any one needs to see the scr shoot say, and i''ll put the server thing back on so u can see it

-J

This topic is closed to new replies.

Advertisement