// Not actual code. Just to give idea
class obj1
{
protected:
int data;
public:
function1();
};
class obj2
{
protected:
obj1 data;
public:
obj1* GetData(); // returns pointer data
}
Function2()
{
obj2 myobj;
myobj.GetData()->function1();
}
Basically, what concerns me, is knowing if it is legitimate to access a pointer to protected data. All my stuff works, but now I seem to be getting these nasty debug failures when running in debug mode ''Access Violation 0xC000005''. (not sure on the digit).
Pointers and classes
I am occasionally getting ''Access Violations'' in my app, so I was wandering if the following is legal (I use stuff like it all the time):
January 18, 2001 02:48 PM
There''s nothing inherently wrong with what you''re doing.
The AV is happening because you''re trying to use a pointer that doesn''t point to a valid object. Probably you forgot to initialize it, or you''re trying to use it after it''s been deleted.
-Mike
The AV is happening because you''re trying to use a pointer that doesn''t point to a valid object. Probably you forgot to initialize it, or you''re trying to use it after it''s been deleted.
-Mike
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement