标签:style blog color os io ar div log sp
union myun { struct { int x; int y; int z; }u; int k; }a; int main() { a.u.x =4; a.u.y =5; a.u.z =6; a.k = 0; printf("%d %d %d\n",a.u.x,a.u.y,a.u.z); return 0;
//输出 0,5,6 }
#include "stdafx.h" #include <iostream> int _tmain(int argc, _TCHAR* argv[]) { union{ struct { int a;int b;int c;
}a; int k; }b; b.a.a=1; b.a.b=2; b.a.c=3; b.k=9; int aa; std::cout<<b.a.a<<b.a.b<<b.a.c; std::cin>>aa; return 0;
//输出 923 }
标签:style blog color os io ar div log sp
原文地址:http://www.cnblogs.com/holyson/p/3951165.html