From -4600358323996836166
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,9684813612e15361,start
X-Google-Attributes: gidf78e5,public
From: sbnaran@bardeen.ceg.uiuc.edu (Siemel Naran)
Subject: pointers: sizeof(pointer)
Date: 1998/06/21
Message-ID: <slrn6oqcgp.lfi.sbnaran@bardeen.ceg.uiuc.edu>#1/1
X-Deja-AN: 364819395
Approved: Fergus Henderson <fjh@cs.mu.oz.au>
X-Original-Date: 21 Jun 1998 16:18:09 GMT
Organization: University of Illinois at Urbana-Champaign
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUANY2ZkuEDnX0m9pzZAQFCDAF+JO6o0GA40uF6YQMKqHEnv95nXvoEjz+R 9TX0wlN82iFdhe2wRySTvY+IhFbLX/zm =PBn4
Reply-To: sbnaran@uiuc.edu
Newsgroups: comp.std.c++


(1)

[X] Do all pointers have the same size?  This
makes sense because a pointer of any type is
just a memory addresss.

[X] But what about inheritance where one pointer
can really be two pointers?  For example, if
class D derives from class B, the a pointer to
a B can also possibly be a pointer to a D.

[X] The business of casting is just a compile
time check on the correctness of our code.
Correct?



(2) Can we assume that sizeof(pointer)=sizeof(int)?


-- 
----------------------------------
Siemel B. Naran (sbnaran@uiuc.edu)
----------------------------------
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]



