Path: utzoo!attcan!uunet!wuarchive!psuvax1!rutgers!dptg!ulysses!andante!alice!ark
From: ark@alice.UUCP (Andrew Koenig)
Newsgroups: comp.lang.c++
Subject: Re: Q: Object pointer arithmetic?
Keywords: what if object and type size is different?
Message-ID: <9980@alice.UUCP>
Date: 27 Sep 89 20:36:17 GMT
References: <543@jvc.UUCP>
Organization: AT&T Bell Laboratories, Liberty Corner NJ
Lines: 13

In article <543@jvc.UUCP>, lpw@jvc.UUCP (Lance Welsh) writes:

> How does pointer arithmetic work when:
>   - the type of the pointer is of a base class type, and
>   - the object pointed to is derived from that type, and
>   - the size of the derived type changed by introducing new member variables?

You can only do arithmetic on a pointer if you know the actual
type of the object to which it points and that object is an
element of an array.
-- 
				--Andrew Koenig
				  ark@europa.att.com