I want to insert the values from vector<uint32_t> A
into vector<uint8_t> B
.
I am doing this way.
#include <stdio.h>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
int main()
{
std::vector<uint8_t> B;
std::vector<uint32_t> A;
B.push_back(3);
B.push_back(5);
A.push_back(2344);
A.push_back(4224);
B.insert(B.end(), A.begin(), A.end());
for (int i = 0; i < B.size(); i++)
{
cout << unsigned(B[i]) << " ";
}
return 0;
}
Output : 3 5 40 128 // How 2344, 4224 got converted into 40 , 128 ?
I want to know how the values from A are getting into B. Also Is it possible to get back the original value from the output ?