How to 共用体

复制代码
#include <stdio.h>
int main()
{
 union Exam{
  struct {
   int x;
   int y;
  }in;
  int a;
  int b;
 }e;
 e.a=1;e.b=2;
 e.in.x=e.a*e.b;
 e.in.y=e.a+e.b;
 printf("%d,%d\n",e.in.x,e.in.y);
 return 0;
}
复制代码

 

posted @   谈笑风生膜法师  阅读(135)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示