| 28 | } |
| 29 | |
| 30 | int main() { |
| 31 | quint64 v = strtoull("4433ffeeddccbb00", NULL, 16); |
| 32 | printf("%lld\n", v); |
| 33 | |
| 34 | const string string64bitInt = "4433ffeeddccbb00"; |
| 35 | stringstream s(string64bitInt); |
| 36 | quint64 int64bitInt = 0; |
| 37 | printf("1\n"); |
| 38 | s >> hex >> int64bitInt; |
| 39 | printf("2\n"); |
| 40 | |
| 41 | stringstream out; |
| 42 | out << hex << qbswap(int64bitInt); |
| 43 | |
| 44 | cout << out.str() << endl; |
| 45 | cout << hex << int64bitInt << endl; |
| 46 | cout << string64bitInt << endl; |
| 47 | |
| 48 | if (out.str() != "bbccddeeff3344") { |
| 49 | cout << "Failed!" << endl; |
| 50 | } else { |
| 51 | cout << "Succeeded!" << endl; |
| 52 | } |
| 53 | |
| 54 | return 0; |
| 55 | } |