Thread: STL - Bitoperator functions

  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

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-23-2004, 11:22 PM
  3. STL or no STL
    By codec in forum C++ Programming
    Replies: 7
    Last Post: 04-12-2004, 02:36 PM
  4. Prime Number Generator... Help !?!!
    By Halo in forum C++ Programming
    Replies: 9
    Last Post: 10-20-2003, 07:26 PM
  5. include question
    By Wanted420 in forum C++ Programming
    Replies: 8
    Last Post: 10-17-2003, 03:49 AM