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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:56:04+00:00 2026-05-26T20:56:04+00:00

I am quite unfamiliar with operating on individual bits. This question is more of

  • 0

I am quite unfamiliar with operating on individual bits. This question is more of a sanity check than anything else:

I would like a list of, say, one million individual bits. To do this, I should create a list of 1000000/16 unsigned ints. Then, by iterating through these unsigned ints I can use bitwise operators to set the individual bits to the values I desire.

Is this correct, or am I being really dumb?
If I am on the right track, am I always guaranteed that an unsigned int will be 16 bits?

  • 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-26T20:56:04+00:00Added an answer on May 26, 2026 at 8:56 pm

    No, there’s no guarantee that unsigned int will be 16 bits wide. Use uint16_t instead.

    When you say “list”, do you mean an array or a linked list? It almost certainly makes more sense to use an array than to use a linked list. It will lead to much better memory utilization, and will enable random access to individual words/bits.

    If you need your “long list” to grow dynamically, it might make sense to consider a two-level structure, such as a growing array (or linked list) of pointers to fixed-size arrays of uint16_t.

    Lastly, given that most modern machines are 32- or 64-bit, it may be more efficient to use either 32- or 64-bit words for this.

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

Sidebar

Related Questions

Quite often see in JavaScript libraries code like this: setTimeout(function() { ... }, 0);
Quite simply, I want an ordered list to work like this: 1. Foo 2.
I'm extremely unfamiliar with both .NET and VB.NET and can't quite figure out how
Quite stumped on this one. I am using the Youtube JS API to determine
Quite not sure why I see this error. I navigate to my Login View
Of course after hours of pondering this problem, the first comment on my question
I would like to use redis to query data from commandline, scripts, web and
I'm quite unfamiliar with C. A comma sepearted string comes in and I need
quite often I have code like the following if (operator == Equal || operator
Quite often, Git and Ruby on Rails looks like magic... such as in 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.