#include <iostream>
using namespace std;
int main()
{
int mm = 0x11223344;
char *ppp = (char*)&mm;//int转成char*
cout << mm << endl;
int aa ;
((char*)&aa)[0] = ppp[0]; //char*转换成int
((char*)&aa)[1] = ppp[1];
((char*)&aa)[2] = ppp[2];
((char*)&aa)[3] = ppp[3];
cout << aa << endl;
}
using namespace std;
int main()
{
int mm = 0x11223344;
char *ppp = (char*)&mm;//int转成char*
cout << mm << endl;
int aa ;
((char*)&aa)[0] = ppp[0]; //char*转换成int
((char*)&aa)[1] = ppp[1];
((char*)&aa)[2] = ppp[2];
((char*)&aa)[3] = ppp[3];
cout << aa << endl;
}