Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > Using: bitset( ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 45773 of 45898
Post > Topic >>

Using: bitset( string() )

by mathieu <mathieu.malaterre@[EMAIL PROTECTED] > May 6, 2008 at 04:02 AM

Hi there,

  I must be doing something wrong, but I do not understand the
documentation for bitset( string ), shouldn't this be equivalent (ref
== mask ) ?


#include <bitset>
#include <iostream>
#include <string>

int main()
{
  std::bitset<8> ref( 13ul );
  std::cout << ref << std::endl;

  const char v[] = "1101";
  std::bitset<8> mask( std::string(v) );
  std::cout << mask << std::endl;
  return 0;
}


Thanks
-Mathieu




 3 Posts in Topic:
Using: bitset( string() )
mathieu <mathieu.malat  2008-05-06 04:02:00 
Re: Using: bitset( string() )
Pete Becker <pete@[EMA  2008-05-06 07:14:56 
Re: Using: bitset( string() )
mathieu <mathieu.malat  2008-05-06 04:52:01 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu May 15 0:44:47 CDT 2008.