--- In [email protected], SUMAN <[EMAIL PROTECTED]> wrote:
>
> hi,
> what is an incomplete data type in c?
> consider the example:
>
> typedef int TYPE[];
> TYPE t = {1,2,3};
> printf("%d",sizeof(t));
>
> *// acceptable. necessary information about it is known.*
This definition of variable "t" allocates a known amount of memory,
namely enough memory for three int values. This size is given
implicitly by the initialisation list {1,2,3}.
> **
> *why is this giving an error? *
> **
> printf("%d",sizeof(TYPE));
This statement will be compiled as:
printf( "%d", sizeof( int[]));
How can the compiler know what array you mean here? You haven't given
any clue about the size of the array in this case.
Hope this helps.
Regards,
Nico