So, with the given code, we can say that c[0]=0x10 and c[1]=0x11.Code:#include <iostream> using namespace std; int main() { char * c = new char[1]; *(c+0) = 0x10; *(c+1) = 0x11; unsigned int i = *(c); cout << i; return 0; }
My question is, how could I combine both values into a single integer(2bytes)?
What I want is my program to output 4113 (0x1011)



LinkBack URL
About LinkBacks



