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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:17:17+00:00 2026-06-01T20:17:17+00:00

Do any of the operations dealing with masking or extracting individual bits from an

  • 0

Do any of the operations dealing with masking or extracting individual bits from an integer depend on endianness? I’ve written some code, but with access only to hardware of one type, I can’t really check that its operators are endian-independent. Please let me know if you see any bugs. NOTE: This code was written for a homework problem, and personal edification:

 void PrintDecimalIntegerInBinary (long long n) 
 {  
    PrintDecimalInBinaryRecursion(n, n >= 0);
 }

 void PrintDecimalInBinaryRecursion (long long n, bool sign) 
 {
    if (n == 0) {
        cout << (sign ? 0x0 : 0x1);
    }
    else {
        PrintDecimalInBinaryRecursion((unsigned long long)n >> 1, sign);
    cout << (n & 0x1);
    }     
 }

Thanks for your help.

  • 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-01T20:17:18+00:00Added an answer on June 1, 2026 at 8:17 pm

    Endianness only determines how data is stored, not how it’s processed. So any bitwise operators or bit shifting are unaffected by endianness. Specifically, 0x1 means the same thing regardless of the endianness.

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

Sidebar

Related Questions

I am dealing with some queries for my assignment and any help would be
I'm dealing with some code at work that includes an expression of the form
Are there any efficient bitwise operations I can do to get the number of
I need to force any time related operations to GMT/UTC, regardless the timezone set
Can any of STL algorithms/container operations like std::fill , std::transform be executed in parallel
I know it seems like a simple operation, but I can't find any resource
Here's an interesting problem. Is there a way to write some code using LINQ
Are there any specific benefits derived from defining a utility function directly on the
I inherited some code that has two non-UI threads that update various WinForm controls.
I'm hacking away at some code which seems to have been started, at least

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.