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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:45:48+00:00 2026-06-11T04:45:48+00:00

I am stuck in a conversion / definition of a function parameter and would

  • 0

I am stuck in a conversion / definition of a function parameter and would very much appreciate some help. I am sure it’s an easy one for any experienced c/c++ guy, but not for me, not right now.

Problem:

creating the right parameter to use with myCommmand(uint8 *pAddr), which will execute send(pAddr, 6), which will use those parameters to loop the following 6 times:

write(reinterpret_cast<unsigned char*>(pAddr)[i]);

my trouble is, that pAddr has to point to an array of 6 bytes, which i most preferably would like to define as unsigned byte values (0-255) or as hex 00-FF.

Restrictions

Functions shall not be changed. It is just about creating the parameters.

My attempts:

uint8 Addr[] = {00,22,122,205,16,04};
uint8 *pAddr = &Addr;

but this results in error C2440 (can’t convert uint(*)[6] to uint8 *).

Desired solution

I would like to know a good, wellformed way to create this Addr-array or stream, or object to pass on to my functions, by writing their byte or hex values into my code – like in my attempt. I can use boost-libraries. Thanks to all helping me out with 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-06-11T04:45:50+00:00Added an answer on June 11, 2026 at 4:45 am

    Have you tried

    uint8 Addr[] = {0x0,0x16,0x7a,0xcd,0x10,0x4};
    uint8 *pAddr = Addr;
    

    ?

    Note: Do not use 0 prefix! It means the number is in octal, so 010 means 8 in dec.

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

Sidebar

Related Questions

I'm stuck with a string conversion to xs:date. I would really appreciate any help
Once again I need some help. I'm creating a multiple file upload function with
Been stuck on this for ages. Currently learning Django and done some bits on
im stuck with a problem im basically trying to create a function where I
My problem seems to be very simple but I'm stuck here. I have a
This might be a trivial one, but I kind of stuck here. I have
I am doing code conversion from JavaScript to VB.NET . I am stuck with
I'm looking for the conversion from the PHP code to Delphi. Currently, i'm stuck
I'm working on a VB.NET to C# conversion and I'm currently stuck with a
I have one python script which i am trying to convert and stuck in

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.