R
Rob
I seek to be able to store data in a static variable that has no
specifically defined type/size. Or to put it another way, I wish to
create a structure of data but without the ability to reference its
subcomponents until I cast it to another predefined type.
In my attempts of doing this (I don't know if it is even possible), I
encountered a feature of some sort that seems to be legal, but yet I
don't know what it does. It involves inserting a type followed by a
colon followed by a constant. Here's an example:
struct {
int : 0;
long : 5;
short : 2;
} s;
What does this do? Does it have anything to do with the functionality I
am after? When I attempted to cast this struct it wouldn't allow me to;
it gave the error "cannot convert from '' to <type_name>".
specifically defined type/size. Or to put it another way, I wish to
create a structure of data but without the ability to reference its
subcomponents until I cast it to another predefined type.
In my attempts of doing this (I don't know if it is even possible), I
encountered a feature of some sort that seems to be legal, but yet I
don't know what it does. It involves inserting a type followed by a
colon followed by a constant. Here's an example:
struct {
int : 0;
long : 5;
short : 2;
} s;
What does this do? Does it have anything to do with the functionality I
am after? When I attempted to cast this struct it wouldn't allow me to;
it gave the error "cannot convert from '' to <type_name>".