I have two classes: A and Bar, both have a common header file, which essentially has Foo * foo. Class A creates a Bar bar object. It works great. However, if I create an instance of the object
Bar* bar = new Bar();
I get an access violation when a bar tries to do something with foo. Why does it matter?
If I do not use "new", it works fine. This is mistake:
Unhandled exception at 0x003c17ea in Direct3DTutorial7.exe: 0xC0000005: Access violation reading location 0x00000000.
Thanks.
source share