Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <sstream>
- #include <string.h>
- using namespace std;
- int main()
- {
- string normal;
- int const Value = 3496683923;
- unsigned char const *pByte = (unsigned char const *)&Value;
- for (size_t i = 0; i < sizeof (Value); ++i)
- {
- cout << hex<< static_cast<int>(pByte[i]) << endl;
- }
- cout << endl;
- return 0;
- }
- res = 0;
- for (size_t i = 0; i < sizeof (Value); ++i)
- {
- res = (res<<8) | (Value & 0xFF);
- Value >>= 8;
- }
Add Comment
Please, Sign In to add comment