Incomplete type

Discussion in 'C Programming' started by prashna, Jun 27, 2003.

  1. prashna

    prashna Guest

    Hi friends,
    What is an incomplete type in C?
     
    prashna, Jun 27, 2003
    #1
    1. Advertisements

  2. To paraphrase the C standard, an incomplete type is a type that describes an
    object but lacks information needed to determine its size. Examples include

    /* forward-declared struct */
    struct foo;

    /* my_array is an array of ints, but we don't know how big */
    extern int my_array[];

    void is another incomplete type. Unlike other incomplete types, void cannot
    be completed.

    Regards,

    Russell Hanneken
     
    Russell Hanneken, Jun 27, 2003
    #2
    1. Advertisements

  3. On 27 Jun 2003 03:14:05 -0700, in comp.lang.c ,
    its a type which is, er, incomplete. Such as
    struct foobar;
    foobar is incomplete because you've not defined its members.
     
    Mark McIntyre, Jun 27, 2003
    #3
  4. Well, hmm, I think it is more correct to say that it is
    incomplete because you cannot determine the size of an object
    of type struct foobar. (which is of course a side effect of
    the compiler not knowing the members of the struct, but this
    view is to simplistic I think).
     
    Thomas Stegen, Jun 28, 2003
    #4
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.