STL - Bitoperator functions

This is a discussion on STL - Bitoperator functions within the C++ Programming forums, part of the General Programming Boards category; Im pretty new on STL-programming. For the moment Im playing around with bit-operators. The problem is that I'm trying to ...

  1. #1
    Veni Vidi Vice
    Join Date
    Aug 2001
    Posts
    343

    STL - Bitoperator functions

    Im pretty new on STL-programming. For the moment Im playing around with bit-operators.
    The problem is that I'm trying to use a function called to_string() that should return a 'bitpattern' in format of string, but it isn;t workinnggg.

    Code:
    #include <iostream.h>
    #include <bitset>
    #include <string>
    
    int main()
    {
    int value = 2:
    bitset <4> b = value;
    string bitpattern = b.to_string():
    cout << "BitString: " << bitpattern << endl:
    }
    When I try compile this code a get an error like "no matching function for call to bitset<4, long unsigned int>::tostring()"

    Thx in advance

  2. #2
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,493

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C Formatting Using STL
    By ChadJohnson in forum C++ Programming
    Replies: 4
    Last Post: 11-18-2004, 05:52 PM
  2. im extreamly new help
    By rigo305 in forum C++ Programming
    Replies: 27
    Last Post: 04-24-2004, 12:22 AM
  3. STL or no STL
    By codec in forum C++ Programming
    Replies: 7
    Last Post: 04-12-2004, 03:36 PM
  4. Prime Number Generator... Help !?!!
    By Halo in forum C++ Programming
    Replies: 9
    Last Post: 10-20-2003, 08:26 PM
  5. include question
    By Wanted420 in forum C++ Programming
    Replies: 8
    Last Post: 10-17-2003, 04:49 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21