Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!uxc.cso.uiuc.edu!uxc.cso.uiuc.edu!ux1.cso.uiuc.edu!uxa.cso.uiuc.edu!jpd00964 From: jpd00964@uxa.cso.uiuc.edu Newsgroups: comp.sys.mac.programmer Subject: Re: Object Oriented C for the Mac Message-ID: <227700016@uxa.cso.uiuc.edu> Date: 24 Jul 89 04:50:00 GMT References: <44053@tiger.oxy.edu> Lines: 29 Nf-ID: #R:tiger.oxy.edu:44053:uxa.cso.uiuc.edu:227700016:000:1316 Nf-From: uxa.cso.uiuc.edu!jpd00964 Jul 23 23:50:00 1989 > what are the primary differences between > object-oriented C and normal, run-of-the-mill C? Object oriented C can be one of two things. 1> objective C, which is a preprocessor, therefore effectively run-of-the-mill C with some standard routines to do object oriented programming. 2> C++ which is an extension to c and therefore not normal C. Object oriented programming is a method of storing routines in "objects" with their variables. This allows easy portability. I can in a given object, define my variables to be any name since only these routines can affect the variables. The methods (functions by a different name) can be accessed by any other object. So if you have a pointer to your object, and a routine offset table, then can always indirectly get any variable. The advantages: All objects can be made interchangable. For example. If I have a cup object, that keeps track of the weight of all objects in it. As I add a new object, it just needs a method called getWeight. The cup will call getWeight and my new object will return the correct weight. The cup does not have to concern itself with how a pen and another cup differ, the same called method will concern itself. I have a better idea, read Object oriented programming by Cox. It's a very good book Michael Rutman Softmed