Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ll-xn!ames!necntc!cullvax!drw From: drw@cullvax.UUCP (Dale Worley) Newsgroups: comp.lang.c Subject: How big is a (??? *) Message-ID: <1217@cullvax.UUCP> Date: Wed, 27-May-87 10:40:09 EDT Article-I.D.: cullvax.1217 Posted: Wed May 27 10:40:09 1987 Date-Received: Fri, 29-May-87 06:11:25 EDT Organization: Cullinet Software, Westwood, MA, USA Lines: 24 doug@edge.UUCP (Doug Pardee) writes: > I want to do what is sometimes called "object-oriented" programming. > Each source module consists of a bunch of routines which operate on a > particular kind of object. Each instance of an object is described in > detail by a struct which is malloc'ed by the object's "create" routine. > [...] > Unfortunately, as we've seen, that means that the outside world doesn't > even know how big the pointer is. So, it seems that I can't use the > straightforward approach of having the handle be the pointer to the > structure. My taste is that the cleanest method is to say: typedef char *handle; Now, cast everything to and from 'handle' -- by ANSI C, casting a pointer to char * and back is guaranteed to not screw up. Dale -- Dale Worley Cullinet Software UUCP: ...!seismo!harvard!mit-eddie!cullvax!drw ARPA: cullvax!drw@eddie.mit.edu Un*x (a generic name for a class of OS's) != Unix (AT&T's brand of such)