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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:29:16+00:00 2026-06-17T13:29:16+00:00

I have the hex value 0x5a800000000b and I’m trying to get a printf statement

  • 0

I have the hex value 0x5a800000000b and I’m trying to get a printf statement in C to print it to the console.

So far (because I’m useless in C) I’m able to get the ‘b’ to print, using the syntax:

printf("Hex value%x\n", value);

The value is stored in an integer type U32, but after trying all different combinations of %llx, %lx, I just keep getting compiler warnings.

I’m guessing that I’m getting the printf syntax wrong, but I can’t seem to find the right % option, can someone help me out?

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-17T13:29:18+00:00Added an answer on June 17, 2026 at 1:29 pm

    It’s not a problem with the printf.

    The problem is that a 32 bits variable cannot hold the value 0x5a800000000b. 32 bits can hold only 8 hex digits: 0x0000000b. Hence the b on output.

    To store such a large value, you should use a 64 bits variable.

    long long value = 0x5a800000000bLL
    

    Note also the double L at the end. It tells the compiler that the constant is also a long long.

    Then you can use %llx in the printf format string.

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

Sidebar

Related Questions

We have %x in C to print any decimal value as hex value like
Very basic Question. :(. I have a hex value and trying to accommodate into
I have a hex value (0x0020004E0000 ... which is the base address to a
I have a hex value in a string like h = '00112233aabbccddee' I know
If I have a hex value of 53, what is the best way in
I have to convert a normal string array with the value {STX,ETX} into hex
I have a hex value to a window i found using Spy++. the value
I have this hex value 93 which in decimal value should be 147. Since
I have the JavaScript for converting a HEX value to RGB but I was
So, I have a value of type __be16 (2 bytes). In hex, the value

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.