Can anyone tell me how to convert unsigned long long int into vector and vice versa.
For converting from unsigned long long int to vector, I tried the following:
unsigned long long int x;
vector<char> buf(sizeof(x));
memcpy( &buf[0], &x, sizeof( x ) );
When I tested for x = 1234567890, it failed. But when I tried it for smaller values of x (say 1-100), it works...
For converting vector to unsigned long long int, I used:
unsigned long long int = (unsigned long long int)buf[0];
Can anyone tell me how to do it.