| ??? 04/21/03 14:19 Read: times |
#43852 - Universal casting to structs/union/void Responding to: ???'s previous message |
Maybe this will help ....
#define CAST(new_type,old_object) (*((new_type *)&old_object)) Example of CAST macro at work union { char ch[4]; int i[2]; } my_union; long longvar; longvar = (long)my_union; // Illegal cast longvar = CAST(long, my_union); Legal cast found on the internet used in a linux project ... |
| Topic | Author | Date |
| Pointers to Structure Elements | 01/01/70 00:00 | |
| RE: Pointers to Structure Elements | 01/01/70 00:00 | |
| RE: Pointers to Structure Elements | 01/01/70 00:00 | |
| RE: Pointers to Structure Elements | 01/01/70 00:00 | |
| RE: Pointers to Structure Elements | 01/01/70 00:00 | |
| RE: Pointers to Structure Elements | 01/01/70 00:00 | |
| RE: Pointers to Structure Elements | 01/01/70 00:00 | |
| RE: Pointers to Structure Elements | 01/01/70 00:00 | |
| RE: Pointers to Structure Elements | 01/01/70 00:00 | |
| RE: Pointers to Structure Elements | 01/01/70 00:00 | |
| Universal casting to structs/union/void | 01/01/70 00:00 | |
RE: Universal casting to structs/union/void | 01/01/70 00:00 |



