PREV INDEX NEXT

Author: Stan Eisenstat
Subject: Re: [Cs223] Defining pointer to array
Date: Wednesday, 15 Apr 2020, 08:59:51


    > Message Posted By: Unknown
    >
    > In defining a struct entry (representing the entries of the hashtable), I
    > want to have one of its fields be a pointer to an array of struct triples.
    >
    > Do I do something like struct triple[] *ptr?

No, since that would not be valid C.
=====

    > Or is doing struct triple *ptr sufficient, since a pointer to an array = a
    > pointer to the first element of the array = a pointer to a struct triple?

Yes, for precisely the reason you state.

--Stan-
PREV INDEX NEXT