S
sarathy
Hi,
1. I executed the following code. But could not deduce anything from
the results. Can anyone please help me out.
# include <stdio.h>
struct struct1{ const :16; volatile :4;};
struct struct2{ int :1; unsigned :1;
const :16; volatile :4;};
int main()
{
printf ("Size of struct 1 = %d\n",sizeof(struct struct1));
/* Prints 4 */
printf ("Size of struct 2 = %d\n",sizeof(struct struct2));
/* Prints 3 */
}
2. Also what is meant by "incomplete type" in C?
3. What does tag refer to in a struct/union declaration?
Regards,
Sarathy
1. I executed the following code. But could not deduce anything from
the results. Can anyone please help me out.
# include <stdio.h>
struct struct1{ const :16; volatile :4;};
struct struct2{ int :1; unsigned :1;
const :16; volatile :4;};
int main()
{
printf ("Size of struct 1 = %d\n",sizeof(struct struct1));
/* Prints 4 */
printf ("Size of struct 2 = %d\n",sizeof(struct struct2));
/* Prints 3 */
}
2. Also what is meant by "incomplete type" in C?
3. What does tag refer to in a struct/union declaration?
Regards,
Sarathy