I am working on turbo C on windows where char takes one byte.Now my problem is with the below union.
union a
{
unsigned char c:2;
}b;
void main()
{
printf(\
I'm not sure where you find the requirement that the union must be precisely the minimum size. An object must be at least as big as its members, but that is a lower bound only.
You can't take the address of a bitfield; what would be its type? It can't be int*. scanf(%d) will write sizeof(int) * CHAR_BIT bits to the int* you pass in. That's writing more than 2 bits, yet you don't have that space.