August 11th, 2009, 08:14 PM
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...
August 11th, 2009, 06:41 PM
Thanks. Here is what I got for converting back and forth between strings and unsigned chars.
string myString1 = "01001010";
cout << myString1 << endl;
bitset<8>...
August 11th, 2009, 02:13 PM
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...
August 11th, 2009, 01:10 PM
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...
August 11th, 2009, 01:05 PM
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;
}
};
...
August 11th, 2009, 12:37 AM
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...