union的疑问

来源:互联网 发布:java jface 编辑:程序博客网 时间:2024/06/17 18:39
/*为什么
A={“a”}  A.l=97
A={“aa”}  A.l=24929  怎么得来的呢
A={“ab”}  A.l=25185   与上一个 数值差256 
 
*/
#include <stdio.h>
#include<iostream>
using namespace std;
union a
{
    char str[4];
     int l;
}A={"a"};
int main()
{    cout<<A.l;
    system("pause");
    return 0; 
}
0 0
原创粉丝点击