Advertisement

weird in member function class/class/surface assignment

Started by December 06, 2004 06:32 PM
1 comment, last by Drew_Benton 20 years, 2 months ago
ok this is really weird its not that i have a problem im just wondering why this is ok i have a class(A) that has another class(B) as a member that has a Surface*(B) but when i try to load in a bitmap from a txt file that via another text file that gives me the name of the .bmp that is too be loaded it freaks out and gives me an error box thing you know those WE HAVE ENCOUTERED AN ERROR WHILE RUNNING BLABLA.exe but when i just make a seprate surface* member in class A then load it in everything is fine im just wondering what the deal is with classA->classB->Surface* as you can tell ive resolved the problem i just want to know whats up [looksaround] i hope i explained it ok thanks[smile]
____________________________"This just in, 9 out of 10 americans agree that 1 out of 10 americans will disagree with the other 9"- Colin Mochrie
ClassA->Classb = new ClassB();

Do that?
Advertisement
If you could paste some example code if you are still curious, that would help, but other than that "classA->classB->Surface*" is perfectly valid and all, most of the time when you use pointers and don't allocate new memory, as ImperfectFreak said, it will crash.

This topic is closed to new replies.

Advertisement