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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:42:17+00:00 2026-05-26T23:42:17+00:00

if i have a bitset<16> bits(*iter) and a my short how i can assign

  • 0

if i have a bitset<16> bits(*iter) and a my short
how i can assign this bist to my short?

short myShort = ??bits??

It’s possible to convert a bitset<16> to short?

  • 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-26T23:42:18+00:00Added an answer on May 26, 2026 at 11:42 pm

    You really should use an unsigned short, to avoid language quirks on the high bit.

    unsigned short myShort = (unsigned short)bits.to_ulong();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can have std::bitset< 10 > bitsetA; or const size_t LengthB = 20; std::bitset<
I have a function where i use bitset.Now i need to convert it to
I have picked up this example which converts BitSet to Byte array. public static
I'm looking for a bitset implementation with fast bit appending, where several bits can
Ok, this is what I have. I have a 1d bitmap (or bitarray, bitset,
I have some Java code which performs bitwise operations on a BitSet. I have
Is there a way to find out size of a std::bitset ? I have
Have you managed to get Aptana Studio debugging to work? I tried following this,
i have tried to implement following code #include <iostream> #include <bitset> using namespace std;
I have a BitSet and want to write it to a file- I came

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.