Incomplete type

R

Russell Hanneken

prashna said:
What is an incomplete type in C?

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
(e-mail address removed)
 
M

Mark McIntyre

On 27 Jun 2003 03:14:05 -0700, in comp.lang.c ,
Hi friends,
What is an incomplete type in C?

its a type which is, er, incomplete. Such as
struct foobar;
foobar is incomplete because you've not defined its members.
 
T

Thomas Stegen

Mark said:
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.

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).
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top