Sign in to follow this  
ARC inc

Native' has exited with code 0 (0x0)

Recommended Posts

I don't think it's anything to be alarmed about, I get it all the time when the program I'm debugging ends. Although it usually shows the PID and process name like "'[1234] Foo.exe: Native' have exited with code 0 (0x0)'" as well, not just an empty space. At any rate, I wouldn't worry, it's just helpful debugger output. It also prints a similar message when threads terminate.

Share this post


Link to post
Share on other sites
alright but it is something to worry about for me because my program randomly crashes when it gets to the spot where it's supposed to be an that is when I get the error also I keep on getting a C4700 Warning

Share this post


Link to post
Share on other sites
That means, nominally, that everything went well and the thread exited correctly.

Post the exact code (and its immediate environment) that the C4700 points to, since that might well be the source of your problem. C4700 is use of a variable before assignment.

Share this post


Link to post
Share on other sites
Quote:
Original post by ARC inc
alright but it is something to worry about for me

Don't. All it means is that the program exited (like all programs eventually do), and returned a status code of 0 (either by returning it from main(), not returning and reaching the end of main(), or by calling exit(0)). Zero typically means 'success', non-zero typically means some kind of error.

Quote:
because my program randomly crashes when it gets to the spot where it's supposed to be an that is when I get the error also I keep on getting a C4700 Warning

This is more relevant, on the other hand. It's worth pointing out that most of us don't have each error code memorized -- it's a good idea to post full error messages instead of making people look the message type up. It makes it easier to help, which in turn usually means more people willing to help.

Share this post


Link to post
Share on other sites

if(option ==1)
{
p->new_game();
}


this is where I am getting my C4700 error it says p was local an not initlized but I have Game *p; which points to my Game class/functions an I have no idea why it is doing this to me. Someone also told me my pointer is going to garbage varibles would this have something to do with it? because the pointer I am using for this little part goes to a new_game function which creates a account.dat file for loading the game.

Share this post


Link to post
Share on other sites
*facepalm*

Yes. "Game *p;" declares a pointer. It does not initialize the pointer. Trying to use a pointer that isn't set to point at anything specific will at best crash.


Try this:
Game *p = new Game();



Or better yet, consider avoiding pointers entirely:
Game mygame;
...
if(option ==1)
{
mygame.new_game();
}




It seems this was all explained in your previous thread about this crash?

Share this post


Link to post
Share on other sites
Quote:
Original post by ARC inc
*** Source Snippet Removed ***
this is where I am getting my C4700 error it says p was local an not initlized but I have Game *p;


So, let's see what I told you last time:

Quote:
Most likely, you have something like this:

Game* game; // on a previous line
game->new_game(); // line 16


Wow, what do you know, I was right. OK, I wasn't able to guess the name of your variable, and called it 'game' instead of 'p'. But other than that I'm batting 1.000 so far.

Quote:
an I have no idea why it is doing this to me.


Well, what did I say about the situation last time? Let's see:

Quote:
You cannot just do this. It's equivalent to saying "paint that house", while not actually pointing at a house (or doing anything else to indicate which house you mean).

There is no reason why you should want to do this, anyway. You do not require pointers to use instances of classes. Classes simply define data types, and you can use their instances just like you use primitives: i.e., by value.

Thus:

Game game; // on a previous line; actually creates a game
game.new_game(); // uses the game without any need to "point at" it



which is like saying "build a house and then paint it".


Did you not actually read that? Or is there something you still don't understand? Because I really can't think of any way to explain it any more simply.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this