Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Incomplete type

Reply
Thread Tools

Incomplete type

 
 
prashna
Guest
Posts: n/a
 
      06-27-2003
Hi friends,
What is an incomplete type in C?
 
Reply With Quote
 
 
 
 
Russell Hanneken
Guest
Posts: n/a
 
      06-27-2003
"prashna" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> 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
http://www.velocityreviews.com/forums/(E-Mail Removed)


 
Reply With Quote
 
 
 
 
Mark McIntyre
Guest
Posts: n/a
 
      06-27-2003
On 27 Jun 2003 03:14:05 -0700, in comp.lang.c ,
(E-Mail Removed) (prashna) wrote:

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



--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html>


----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
 
Reply With Quote
 
Thomas Stegen
Guest
Posts: n/a
 
      06-28-2003
Mark McIntyre wrote:
> On 27 Jun 2003 03:14:05 -0700, in comp.lang.c ,
> (E-Mail Removed) (prashna) wrote:
>
>
>>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.
>


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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is "incomplete type?" (compiler error) Lou Pecora C++ 6 07-07-2011 05:41 AM
array type has incomplete element type shrav4ever@gmail.com C Programming 1 01-17-2008 08:42 AM
Structure return type is an incomplete type. gk245 C Programming 2 05-06-2006 01:03 AM
Template instantiation of std::list<> with incomplete type Mikhail N. Kupchik C++ 4 09-15-2004 07:27 PM
Incomplete type as template argument Andrew Ward C++ 7 02-25-2004 02:12 PM



Advertisments