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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:30:38+00:00 2026-05-29T19:30:38+00:00

I stumbled on an hacky answer recently ( this one ) where it was

  • 0

I stumbled on an “hacky” answer recently (this one) where it was mentioned that because (I assume 32bit) C/C++ pointers are usually 4byte aligned the last 2 bits of each pointer are always zero. I don’t understand why this should be the case. Why not use all 32bits to represent an address?

Please disregard the merits of the actual answer I linked to above. I’m only interested in the observation regarding the 2 LSBs.

  • 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-29T19:30:41+00:00Added an answer on May 29, 2026 at 7:30 pm

    You may notice the key word “usually” in that statement. “Usually” does not imply “always“. And if something isn’t always true, you can’t assume it to be true and just chop off the last two bits.

    Most pointers to live objects will have alignments of at least 4 bytes. However, you can create an array of chars, and those elements will be byte addressable. That something happens 99% of the time doesn’t mean you can ignore the final 1% where it doesn’t happen.

    The reason why most pointers are aligned to at least 4 bytes is that most pointers are pointers to objects or basic types that themselves are aligned to at least 4 bytes. Things that have 4 byte alignment include (for most systems): int, float, bool (yes, really), any pointer type, and any basic type their size or larger.

    Any object that contains one of these must be aligned to at least the alignment of that object. So an object that stores an int is aligned to 4 bytes. An object that contains a pointer is aligned to at least 4 bytes. And so forth. Rare is the object that doesn’t include one of these basic types.

    That’s why. The vast majority of data types you want to point to will have a minimum of 4 bytes of alignment.

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

Sidebar

Related Questions

In one of the Delphi demo applications, I've stumbled upon some syntax that I
I stumbled upon this 'list of programming' languages and found that popular languages like
I stumbled across this before and I know it is a common problem. One
I stumbled across this code and am too proud to go and ask the
Ever stumbled on a tutorial that you feel is of great value but not
I stumbled over this passage in the Django tutorial : Django models have a
I stumbled across this problem in F#. Suppose, I want to declare two types
I stumbled upon this code and I am curious as to what use may
I stumbled upon this question: 7 power 7 is 823543. Which higher power of
I stumbled on this command while learning AJAX. The guy who made the tutorial

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.