Casting between pointers to union members

后端 未结 0 1580
北荒
北荒 2021-01-23 10:18

If I have a union

union U {
  int i;
  double d;
};

Then I can get pointers to an object\'s members as

U u;
int *ip = &u.i;
do         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题