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

  • SEARCH
  • Home
  • 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 8597885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:01:17+00:00 2026-06-12T01:01:17+00:00

I have 24bit data in 3 array a[0] , a[1] , a[2] and need

  • 0

I have 24bit data in 3 array a[0], a[1], a[2] and need to calculate for multiply and divide by some constant and result still in 3 array.

For example, data = 999900h store in a[0] = 99, a[1] = 99, a[2] = 00

[(999900h/64)*15000]/157286 << **process???**

result will be 3A97h store in b[0] = 00, b[1] =3A, b[2] = 97

My question is

1.) How to write code for fast calculate in the process, pointer in fast? how to use pointer in the process?

2.) It possible no use conversion process like array to integer and integer to array?

  • 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-06-12T01:01:18+00:00Added an answer on June 12, 2026 at 1:01 am

    I like to use unions in this case:

    #inlude<stdint.h>
    
    union array_int {
      char a[4];
      uint32_t num;
    } data = {.a = {00, 99, 99, 00}};
    
    printf("%d", data.num);
    

    Please take endianess into account. use htonl if you put in your bytes most significant – to least significant, but are on a little endian system. If you don’t want to mess around with endianess then I suggest you use one of the suggested algebraic suggestions.

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

Sidebar

Related Questions

MASSIVE EDIT: I have a long int variable that I need to convert to
I have some working code that uses IImgCtx to load images, but I can't
Problem: I have a list of 2500 websites and need to grab a thumbnail
I have a byte[] array received in TCP Client.The array contains a 24-bit RGB
I have a ARGB image data. I wish to set my window icon to
I’ve got an array of PCM data; it can be 16-bit, 24-bit packed, 32-bit,
I have a data structure that stores amongst others a 24-bit wide value. I
I have image buffer in 24bit RGB format. This buffer is copied to cv::Mat
I have a need to convert an Int32 value to a 3-byte (24-bit) integer.
I have a project that I am working on where I require a data

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.