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

  • Home
  • SEARCH
  • 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 729061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:45:14+00:00 2026-05-14T06:45:14+00:00

I am reading a file byte-by-byte. Say for example i have this byte: 0x41

  • 0

I am reading a file byte-by-byte.

Say for example i have this byte: 0x41 (0100 0001) represented in hex.

Now, I want the first three bits of this byte, i.e (010).

I can use bitwise logic to extract the first three bits, but my question is will the first three bits be independent of endianess of the machine.(i.e they can’t be 001)?

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-05-14T06:45:14+00:00Added an answer on May 14, 2026 at 6:45 am

    Another way to think of this is that endianness only applies when you can read the components of an item individually – since you can typically independently read from memory the individual bytes of a 32-bit int, if you want to interpret those bytes as a 32-bit int you need ot ensure that the endianess of the architecture is taken into consideration.

    Normally you can’t read from memory the individual bits of a byte, so there really is no concept of ‘bit endianness’ as far as memory architecture is concerned (I’m sure there is at the hardware level, but not something you can see at the software level). A few areas where you might need to deal with (or at least be aware of) bit endianness:

    1. the order that the compiler stores bits of a bit field is compiler dependent (and is not necessarily related to the endianess of the hardware platform – different compilers might order bit fields differently for the same platform – it’s possible that a compiler could be configured one way or the other using command line options, similar to the way char might be set to be signed or unsigned). However, C bit fields really have nothing to do with hardware addressing.

    2. some hardware architectures do allow you to address individual bits (the ARM Cortex M3 for example), so in this case you’d need to know how the architecture arranged for bits to be addressed if you were to use that feature.

    3. if you’re sending bits over a serial link – the hardware interface will typically specify whether the most significant bit or least significant bit is ‘shifted’ out on the wire first.

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

Sidebar

Related Questions

I am reading a text file with this format: grrr,some text,45.4321,54.22134 I just have
I want to open a file for reading, the C++ way. I need to
I'm reading in a file with Python's csv module, and have Yet Another Encoding
Is it possible to do this? I'm reading an XML file that has the
I have a 16mb binary file and I want to read bytes without using
With the following file reading code: using (FileStream fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read,
Are there any good configuration file reading libraries for C\C++ that can be used
I am using the following method for reading Csv file content: /// <summary> ///
I am reading a binary file into a parsing program. I will need to
I am reading in CSV file and translating it to an SQL Table. The

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.