Hi. I've got a union, containing several structures in C like this:
======================================... {
struct bit_values
{
unsigned char b0:1;
unsigned char b1:1;
unsigned char b2:1;
unsigned char b3:1;
} b;
struct input_data
{
unsigned char gp1:1;
unsigned char gp2:1;
unsigned char gp3:1;
unsigned char gp4:1;
unsigned char gp5:1;
unsigned char gp6:1;
unsigned char gp7:1;
unsigned char gp8:1;
} in;
struct eight_bit_words
{
unsigned char A:8;
unsigned char B:8;
} eight_bit;
} un;
======================================...
I want to access the data in a variable such as
un.eight_bit.A
from an external function, preferably without passing the entire union. Dev C++ refuses to give me an address to a union member, so does anyone know how?
Tags: