Archived

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

New troubles

This topic is 6359 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
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