T
Tom St Denis
Really ?
I saw ton of code out there which uses pointer casts was used to
implement inheritance in C.
You can mimic the anonymous nature of C++ classes through the use of
structs with pointers to functions. I routinely use them in the
crypto code I write where, for instance, there is a struct which
defines a cipher interface, then the rest of my code calls the cipher
functions through pointers in the struct.
You really should have time when you need to cast from one non-void to
another non-void to do useful work. If anything you should convert
explicitly from one to another. for instance if you have
struct { int a; } ints;
struct { float a; } floats;
And you need to store floats in ints, just do a ints.a = floats.a;
Don't alias the pointers or whatever...
Tom