

struct                      C Keyword                      struct




Data type


struct is a C keyword that introduces a structure.  The following
is an example  of how struct can be used  in the description of a
name and address file:


        struct address {
                char firstname[10];
                char lastname[15];
                char street[25];
                char city[10];
                char state[2];
                char zip[5];
                int  salescode;
        };


_T_h_e  _C _P_r_o_g_r_a_m_m_i_n_g  _L_a_n_g_u_a_g_e, ed. 2  prohibits the  assignment of
structures,  the  passing of  structures  to  functions, and  the
returning of  structures by functions.   COHERENT, however, lifts
these restrictions.   It allows one  structure to be  assigned to
another, provided  the two structures  are of the  same type.  It
also allows structures to be passed by and returned by functions.
These features are  supported by most compilers, but users should
be aware  that their  use can cause  problems in porting  code to
some compilers.

***** See Also *****

array, C keywords, field, structure
























COHERENT Lexicon                                           Page 1


