Correct type for array indices

From: Sean Hamilton (sh_at_bel.bc.ca)
Date: 11/27/04


Date: Sat, 27 Nov 2004 06:44:50 GMT

Hello,

Suppose I have a pointer to some structures. What would be the correct
type to store the number of entries in that array, as well as for indexing
that array? size_t seems like an obvious choice, but off_t also jumps to
mind.

Thanks,

-- 
Sean Hamilton <sh@bel.bc.ca>


Relevant Pages

  • Re: Correct type for array indices
    ... >>Suppose I have a pointer to some structures. ... >>type to store the number of entries in that array, ...
    (comp.lang.c)
  • Re: Correct type for array indices
    ... Sean Hamilton wrote: ... > Suppose I have a pointer to some structures. ... > type to store the number of entries in that array, ...
    (comp.lang.c)
  • Re: A function returning string or pointer
    ... as a result from my previous post I'm busy with splitting code into ... a pointer to this array. ... You /must not/ return a pointer to an array which is a local ... You must return a pointer to store which will outlive the function ...
    (comp.lang.c)
  • Re: array of pointers
    ... > array of pointers is neccesary more RAM memory to store these datas. ... derived type has a pointer component. ... upper bound for each rank, although that is at least largely redundant. ...
    (comp.lang.fortran)
  • Re: My error or bug in "attr_reader" ?
    ... attr_reader:entries ... @entries isn't an array, it's a pointer to an instance of the ... A reference is just a pointer with slightly ...
    (comp.lang.ruby)