CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: OrangeKyo

Search: Search took 0.01 seconds.

  1. Re: Converting from string("01000001") to a byte and back.

    Ah but I require variable length bits. A string of char won't do. Each char is 8 bits long only.

    (When I write to the file I will chunk them into 8 and convert to char naturally.)

    Thanks a...
  2. Re: Converting from string("01000001") to a byte and back.

    Thanks. Here is what I got for converting back and forth between strings and unsigned chars.



    string myString1 = "01001010";
    cout << myString1 << endl;
    bitset<8>...
  3. Converting from string("01000001") to a byte and back.

    AHHHHH! I give up. How do I convert a strings of ones and zeros into a byte that I can write to a binary file??? I've tried everything I can think of. Here is what i have so far:




    string...
  4. Re: Sorting an STL of pointers to comparable objects.

    To Monarch. I probably should have clarified. My mistake.

    The command

    priority_queue<Leaf*,vector<Leaf*>, PairComparator> leaves;

    does not create a priority queue of vectors. It creates a...
  5. Re: Sorting an STL of pointers to comparable objects.

    Awesome. I got it with this. Thanks a bunch.

    class leafcompare {
    public:
    bool operator()(const Leaf *p1, const Leaf *p2) const {
    return p1->frequency > p2->frequency;
    }
    };
    ...
  6. Sorting an STL of pointers to comparable objects.

    Hi, I have a class called Leaf with a member variable int frequency. I want to load pointers of this class into a priority_queue or a sortable vector so that it sorts based on frequency.

    I've...
Results 1 to 6 of 6





Click Here to Expand Forum to Full Width

Featured