Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!munnari.oz.au!caw From: caw@munnari.oz.au (Chris Wright) Newsgroups: comp.sys.mac.programmer Subject: Casting in Think C Keywords: Casts ThinkC Message-ID: <6167@munnari.oz.au> Date: 3 Dec 90 13:29:16 GMT Sender: news@cs.mu.oz.au Lines: 21 Why do you have to cast gApplication in ThinkC e.g.: extern CApplication *gApplication; void main() { gApplication = new(CEditApp); ((CEditApp *) gApplication)->IEditApp(); gApplication->Run(); gApplication->Exit(); } if you remove the cast and try gApplication -> iEditApp(), the compiler complains. new is meant to "automatically assign a class to the newly created object" e-mail me if this is too obvious to waste time on the net for! Thanks chris wright