Re: contiguity of arrays
From: David Hopwood (david.nospam.hopwood_at_blueyonder.co.uk)
Date: 10/03/04
- Next message: j: "Re: Questions"
- Previous message: David Hopwood: "Re: contiguity of arrays"
- In reply to: David Hopwood: "Re: contiguity of arrays"
- Next in thread: Wojtek Lerch: "Re: contiguity of arrays"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 03 Oct 2004 04:24:30 GMT
David Hopwood wrote:
> Wojtek Lerch wrote:
>> What you seem to be saying is that for a region of memory to
>> constitute an array of four ints, it doesn't have to be declared with
>> a type that involves an array of four ints, or designated by an lvalue
>> with such a type, but nevertheless it must be declared with some
>> aggregate type ultimately consisting of four ints and no padding bytes
>> between them.
>
> Yes. This view is based on the definition of "array type" as being the type
> of any contiguous nonempty sequence of objects of the element type. In
> order to perform an access via a given pointer, say of type T, you need to be
> able to infer that it currently points to a region that *can* hold an object
> of type T. The memory allocation functions are a special case that return
> pointers to regions able to hold objects of any type.
... any type that is no larger than the allocated size, of course.
-- David Hopwood <david.nospam.hopwood@blueyonder.co.uk>
- Next message: j: "Re: Questions"
- Previous message: David Hopwood: "Re: contiguity of arrays"
- In reply to: David Hopwood: "Re: contiguity of arrays"
- Next in thread: Wojtek Lerch: "Re: contiguity of arrays"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|