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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:32:05+00:00 2026-06-08T09:32:05+00:00

I was wondering how to manually convert an IP address to a hex value

  • 0

I was wondering how to manually convert an IP address to a hex value on an x86 machine. For example, the book I was reading gives the hex representation of 192.168.42.72 as:

    0x482aa8c0

but never explains how the conversion works. So, how does it?

  • 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-08T09:32:06+00:00Added an answer on June 8, 2026 at 9:32 am

    When you convert an IP to a long integer, you take each octet in reverse order and multiply it by 256^n where n is the zero-based reverse index of the octet

    So for this ip you’re doing

    (72 * 256^0) + (42 * 256^1) + (168 * 256^2) + (192 * 256^3)
    = 3232246344
    = 0xc0a82a48
    

    It looks like the book is doing it backwards, but you get the idea.

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

Sidebar

Related Questions

Question mark I'm wondering whether it's possible for the VM guest machine to pop
I was wondering what the best or most widely used apis are to convert
I know how to manually set JTable column names, but wondering if there was
I'm wondering, what's the origin of asking interviewees to manually parse a string as
I was wondering if anyone anywhere had an example of an AVCapture session using
Wondering what the best / good way of doing this would be in jQuery.
Wondering if any of you can help me: I've made a signup modal that
Wondering if someone could please explain the difference between these two queries and advise
Wondering if someone could help me. I have next to no knowledge with Ajax,
Wondering what I'm missing here. Relatively new to C and iOS development, so please

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.