Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!decwrl!ads.com!potomac!adiseker From: adiseker@potomac.ads.com (Andrew Diseker) Newsgroups: comp.sys.mac.programmer Subject: Problems in ThinkC mixing direct and indirect objects Keywords: direct indirect class definitions address error Message-ID: <9200@potomac.ads.com> Date: 26 Sep 90 19:30:12 GMT Reply-To: adiseker@potomac.ads.com (Andrew Diseker) Distribution: na Organization: Advanced Decision Systems, Arlington VA Lines: 27 I have just had a problem in using an instance of a direct object in the method of an indirect object. This is part of the method code: void IndirectObj::aMethod() { DirectObj *tempObj; : tempObj = new( DirectObj ); tempObj->someMethod(); <<< the debugger stops here with "odd address trap" : delete( tempObj ); } where someMethod() is declared and defined in the DirectObj class definition and code. I changed DirectObj's definition from direct to indirect, and had no further problems. Shouldn't I be allowed to mix types? I do kind of like to have the choice. For example, if tempObj is small, and nothing I do to it will move memory, I want to eliminate the overhead involved with dereferencing handles. -- Andrew Diseker >Advanced Decision Systems >UUCP: sun!sundc!potomac!adiseker >Internet:adiseker@potomac.ads.com "Indeed, many respected computer scientists have difficulty with left and right even though they can manage the logical con- nectives and can be left to write left to right the right Boolean operations"