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 9323101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T04:15:39+00:00 2026-06-19T04:15:39+00:00

I dont know if this is possible, but help give suggestions. I have a

  • 0

I dont know if this is possible, but help give suggestions.

I have a variableunsigned char Var_2_insert; and I have an array const unsigned char insert_here[4];.

This variable is initialized at run time say var_2_insert = 225;. The idea is that index 3 in the array should have the value of var_2_insert always. So I want to try something like

insert_here[4] = { 0x00, 0x02, 0x03, Var_2_insert};

So that any time I try to read the array insert here, It will have the present value of var_2_insert. Now I know if I go like this:

#define Var_2_insert 225

This will go well, but since this variable has to be updated at runtime, I tried

#define _VAR Var_2_insert
insert_here[4] = { 0x00, 0x02, 0x03, _VAR};

But does not work. So how can i go about this? I hope my question is clear enough.

Thanks.

  • 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-19T04:15:40+00:00Added an answer on June 19, 2026 at 4:15 am

    What you can do is have Var_2_insert a pointer to the 3rd index in the array:

    unsigned char insert_here[4]; // since it's updating it shouldn't be const
    unsigned char *Var_2_insert = &(insert_here[3]);
    //you just need to update the use of var_2_insert to dereference..
    //  var_2_insert = 225 // <-- before
       *var_2_insert = 225 // <-- after
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't know if this is possible, but we have an app that has
I need some help. Don't know if this is possible. I want to have
OK, So I don't know if this is possible but? I'm trying to populate
I don't know if this is possible in MS Access, but what I want
I don't know whether this is really possible, but I'm trying my best. If
so I don't know if this is even possible, but one of my close
I don't even know if this is even possible, but I thought I'd ask.
I dont know if this is possible. In SSIS Derived column transformation, can you
First let me say i dont know if this is possible the way im
Friends I dont know is it possible or not, But want to do like

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.