Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int32_t const_data[11];
- int8_t buffer[44];
- int k = 0;
- while (k < 11) {
- for (int j = 0; j < 44; j++) {
- const_data[k] = bf.buffer[j];
- k++;
- }
- }
- #include <iostream>
- int main(){
- std::int8_t input[] = {0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08};
- std::int32_t output[10];
- int count=0;
- for(;count<sizeof(input);count+=sizeof(std::int32_t)/sizeof(std::int8_t)){
- output[count] = static_cast<std::int32_t>(*(reinterpret_cast<std::int32_t*>(&input[count])));
- std::cout<<std::hex<<static_cast<std::int32_t>(input[count])<<":"<<static_cast<std::int32_t>(output[count])<<std::endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement