When I execute this, it outputs 18 (0x12)Code:#include <iostream> using namespace std; int main() { char * c = new char[2]; *c = 0x101112; unsigned int i = *(c); cout << i; return 0; }
Why does 'i' gets 0x12 instead of 0x10 which is the first value in array/pointer *c?