This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: C++: Is there a Value used to designate the end-of-an-array for non-char arrays?
- From: John Love-Jensen <eljay at adobe dot com>
- To: Robert Miesen <bobby_miesen at yahoo dot com>, MSX to GCC <gcc-help at gcc dot gnu dot org>
- Date: Mon, 23 Jan 2006 06:10:56 -0600
- Subject: Re: C++: Is there a Value used to designate the end-of-an-array for non-char arrays?
Hi Robert,
> I am curious if there is any sort of value used to designate the end of
> an array for arrays that are not of type char.
Nothing in particular is used by convention.
You can create your own convention, if you so choose and it works for the
numbers you are working with. For example, if I had an array of floats that
were between -1.0f and +1.0f, I could choose some arbitrary number, say
2.0f, to represent end-of-array.
Alternatively, I could associate an array length size_t and not have an
explicit end-of-array value.
HTH,
--Eljay