For the most part in c++, a class is almost the same as a struct. The key difference is that members in a struct default to public, in a class they default to private. You made all of the members of your class public so it shouldn't really matter.
Your list handling needs some work though. In your code, start is a tree and current and temp are also trees (that are initialized to be a copy of start).
huffman_tree start;
start._char = letterstat[0];
start.count = numberstat[0];
huffman_tree current = start;
huffman_tree temp = start;
I think the code should be something like:
huffman_tree * start = new huffman_tree;
start->_char = letterstat[0];
start->count = numberstat[0];
start->next = NULL;
huffman_tree * current = start;
huffman_tree * temp = start;
In this case current and temp are pointers to the real start node and not just copies of it.
And you need to be EXTRA careful to NEVER assign to start so you can get back to the head of the list.
Hope that helps some, ask questions if I've left you confused.
Murtan
Practically a Master Poster
671 posts since May 2008
Reputation Points: 344
Solved Threads: 116