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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:20:31+00:00 2026-05-22T15:20:31+00:00

I have the following string: s=80 . I need to put this in an

  • 0

I have the following string: s="80". I need to put this in an
unsigned char k[]. The unsigned char should look like this: unsigned char k[]={0x38,0x34}, where 0x38=8 and 0x34=0 These are the hexadecimal values for 8 and 0. How to do this? Need some help!

Please give some code. Thx

I am working on ubuntu c++ code. THX!

I use this for an encryption! I need 0x38 in an unsigned char.PLEASE HELP! Need some code:)

EDIT:

HOW TO OBTAIN THE DEC/CHAR VALUE AND PUT IT IN AN unsigned char k[]?
I’ve realised that it’s ok if in the unsigned char [] i have the dec values {56,52} of the 8 and 0 that i have in the string!

  • 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-22T15:20:32+00:00Added an answer on May 22, 2026 at 3:20 pm

    Assuming you want this string converted as ASCII (or UTF-8) it is already in the correct format.

    std::string  s="80";
    
    std::cout << "0x" << std::hex << static_cast<int>(s[0]) << "\n";
    std::cout << "0x" << std::hex << static_cast<int>(s[1]) << "\n";
    

    If you want it in an int array, then just copy it:

    int   data[2];
    std::copy(s.begin(), s.end(), data);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have the following string: http://pastebin.com/d29ae565b i need to separate each value and put
i have a string which has the following format (3,1,Mayer,Jack). I need all 4
Suppose I have following string: String asd = this is test ass this is
I have the following string and I would like to remove <bpt *>*</bpt> and
I have the following string and need to extract the text inside the div's
I have the following String that I need to parse. I am looking for
Possible Duplicate: splitting a string i have a string which looks like this: http://pastebin.com/m5508ff19
I have a map code in java.This is my following code. Map<String, String> map
I need to split the following string and put each new line into a
I need some help writing a regex. I have the following strings, xxx.yyy.wwwwwaaa_IN_123 xxx.rrrttttt_IN_12355

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.