The Enchanted Cave 2
Delve into a strange cave with a seemingly endless supply of treasure, strategically choos
4.34 / 5.00 31,296 ViewsGhostbusters B.I.P.
COMPLETE edition of the interactive "choose next panel" comic
4.07 / 5.00 10,082 ViewsOkay, I'm making a game but there is a line of code that crashes the game to the desktop, and I have no idea why. The line is:
shotHead->next = NULL;
The structure is:
struct shotNode
{
shot item;
shotNode *next;
};
I know I'm being vague right now, but anyone experiance trouble with this before? I'll try to post more about it later... Right now I have a meeting to go to.
What may man within him hide, though angel on the outward side.
Are you getting a null pointer exception/error? (forgive my java speak)
If that's the case, your pointer is trying to access a method (function?) of the next node. However, because it's null, there's nothing to access. To fix, make sure your code checks that shot.next != null; before attempting to try shot.next.somtfucntion().
If that's not it, are there anymore details you could give?
At 5/9/05 12:57 PM, ManateeGod wrote: Are you getting a null pointer exception/error? (forgive my java speak)
Oh, it's not a problem with that, I know pointers like the back of my hand.
It's just there is one cpp file that if I try to manipulate a pointer in any way it crashes to the desktop. I have no idea what is happening, either.
Here is everything: www.uwplatt.edu/~ronczkaa/shooter.zip
That includes the project etc. Done in VC++ 6.0 and all that jazz.
WAIT A MINUTE! How does one change the security settings of a computer in terms of .net again? I did it before but I'm not sure... Cause it seems like the problem only exists on my work computer.
What may man within him hide, though angel on the outward side.
You might want to include this in your code:
Either
#define WIN32_LEAN_AND_MEAN
or
#define VC_EXTRALEAN
Here's a MSDN site to explain it MSDN
It basically doesn't include headers that are usually not used from the <windows.h> header.
I was looking at the shot.cpp file, all of the other cpp files have it.... my bad
Man.... WTF WTF WTF SHIT ASS BITCH, ETC.
Yeah, so it just dies at the work computer, but at home it pops up a very general "An error has occured" message.
OMGOMG! After writing the above, I just learned that I can't manipulate a pointer IN ANY FILE! I'm freakin' out man!
What may man within him hide, though angel on the outward side.
At 5/9/05 08:57 PM, Lord_Aba wrote: Man.... WTF WTF WTF SHIT ASS BITCH, ETC.
Yeah, so it just dies at the work computer, but at home it pops up a very general "An error has occured" message.
OMGOMG! After writing the above, I just learned that I can't manipulate a pointer IN ANY FILE! I'm freakin' out man!
What "any file"?
Can you point out the line where you actually manipulate the pointer?
I'm too lazy to download the file.
You might be referencing a bad pointer (like 0xcdcdcdcd (aka no-mans-land) or something) to an API function call, that can cause programs to crash to desktop sometimes (since it's not the code of the program itself that causes it to crash)
"no sound in ass"
At 5/10/05 05:26 AM, CronoMan wrote: What "any file"?
Can you point out the line where you actually manipulate the pointer?
I'm too lazy to download the file.
You might be referencing a bad pointer (like 0xcdcdcdcd (aka no-mans-land) or something) to an API function call, that can cause programs to crash to desktop sometimes (since it's not the code of the program itself that causes it to crash)
Any file as in any .cpp file in my project. Even though I can manipulate them in the .h files.
In one of my classes I declare a struct as:
struct shotNode
{
int item;
shotNode *next;
shotNode(int i, shotNode *n)
{
item = i;
next = n;
}
};
Then decalre a global variable:
shotNode *shotHead;
Then in code I do:
shotHead = new shotNode(5, NULL);
This line of code causes it to crash to the desktop after raising a very generic error. It has to be something stupid I'm missing, but I don't see it right now. Specially since I got the game to work the exact same way before...
What may man within him hide, though angel on the outward side.
Yeah, I suck at life. Not only did I use the Draw_Text_GDI wrong, but yeah... You're sposed to new something before you use it.
What may man within him hide, though angel on the outward side.
At 5/10/05 11:44 AM, Lord_Aba wrote: Yeah, I suck at life. Not only did I use the Draw_Text_GDI wrong, but yeah... You're sposed to new something before you use it.
Hehe, even the best make that mistake. I bet John Carmack and Ken Silverman do that all the time
"no sound in ass"