Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3692656
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:17:14+00:00 2026-05-19T04:17:14+00:00

I have _int8 arr[0] = 0; _int8 arr[1] = 0; _int8 arr[2] = 14;

  • 0

I have

_int8 arr[0] = 0;
_int8 arr[1] = 0;
_int8 arr[2] = 14;
_int8 arr[3] = 16;

I need to convert it to one _int32 using as arr[0] as first part <..> and arr[3] as last.
In the end it should be

_int32 back = 3600;

Should I use bit shifts or smth like that to achieve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T04:17:15+00:00Added an answer on May 19, 2026 at 4:17 am

    If you know the byte ordering (i.e. big endian or little endian, check it out on wikipedia), and the array is set up in the right order you can just do:

    back = *(_int32 *)arr;
    

    That’ll just interpret your array of 4 bytes as a buffer holding a single 32-bit integer. In your example though, I think you’ve got it set up for big endian and x86 isn’t. So you’d need to swap some bytes.

    For instance:

    _int32 back = arr[0] << 24 | arr[1] << 16 | arr[2] << 8 | arr[3];
    

    or something like that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have just started using Google Chrome , and noticed in parts of our site,
Have just started using Visual Studio Professional's built-in unit testing features, which as I
I am using SSE2 intrinsics to optimize the bottlenecks of my application and have
I have been pondering on whether or not I should use the typedefs inside
I have a method that has 2 output parameters. The method should take an
Have just started to get into CakePHP since a couple of weeks back. I
I have this template : template <class SourceFormat, class DestFormat, void (*convert)(DestFormat, SourceFormat)> static
I have problems when using strtok. I want token to has a reserved size
I have two tasks for an assignment, one return the number of bits in
I have an array of arrays - information about selection in Excel using VSTO,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.