Re: C++: Is there a Value used to designate the end-of-an-array for non-char arrays?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux