Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct data_unit {
- enum {
- d_A, d_B, d_C
- } dtype;
- union {
- char * a;
- int * b;
- double * c;
- } data;
- };
- char * du_format_table = {"%c", "%d", "%lf"};
- void print_data_unit(data_unit du){
- printf(format_table[du.dtype], du.data.a + du.dtype);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement