Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

SeanHowe

New troubles

This topic is 6644 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok, I have something like this code:
class AiNode;
class AiNodePtr {
 AiNode *ai;
};
class AiNode 
{
 AiNodePtr branches[8];
 void SomeFunction()
 {
  ...
  branches[0].ai=new AiNode;
 }
};
 
And it''s causing a windows invalid instruction error when it reaches the part where it''s newed. Any ideas?

Share this post


Link to post
Share on other sites
Advertisement
Your SomeFunction doesn''t happen to be the constructor does it?

Was it a compile error or a run time error?

Share this post


Link to post
Share on other sites
Very wierd.
Try using sizeof, to see how big each of your classes is.

It almost has to be the case of SomeFunction being activated in a constructor somehow.

How do you declare the first object of the head object?
Try tracing the code into new to see if you end up somewhere in your code (vs microsoft''s.)

I would have to see more code to help more. What you show is fine.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!