i need help, with the collection :: collection -construcor- i dont know what to use in that function as far as intiatiating any objects or data members. there are no data members in collection - collection is implemented using binary search tree and hash table.

i also need help with the copy construcor for collection:

and the main problem in the program is the writeout function: i think that the vendor data gets lost somewhere before it can be saved to file, but i cant find out where!!

can any body help me???

>> need help, with the collection :: collection -construcor
Nothing wrong with an empty constructor

>> also need help with the copy construcor for collection:
With no class data the copy constructor wouldn't do anything either


>>i think that the vendor data gets lost somewhere before it can be saved to file
Maybe its because the class doesn't have any way to save that data so it can be used later.

Sorry but noone can be much help to you without seeing the code.

>> need help, with the collection :: collection -construcor
Nothing wrong with an empty constructor

>> also need help with the copy construcor for collection:
With no class data the copy constructor wouldn't do anything either


>>i think that the vendor data gets lost somewhere before it can be saved to file
Maybe its because the class doesn't have any way to save that data so it can be used later.

Sorry but noone can be much help to you without seeing the code.

what about the attachment???

what about the attachment???

Missed it :-O

collection::~collection()
{
	
	BST tree;
	tree.~BST();
}

Remove that code (lines 4 and 5) because the BST destructor will be called when the collection class object is destroyed. Line 4 above is hiding the class object declared in the header file.

collection::collection (char * fileName,vendor & avendor)
{
	
    hash("oo.txt");  //call hash's filename constructor in hash class
	BST("oo.txt");   //call bst's filename construcor in bst class
	
}

That code is wrong too. Use the object names, not the class names, like below: But the code below is also probably wrong because it doesn't use the two parameters for anything. Maybe you are supposed to pass them on to tree and table??

collection::collection (char * fileName,vendor & avendor)
{
	
    table("oo.txt");  //call hash's filename constructor in hash class
    tree("oo.txt");   //call bst's filename construcor in bst class
	
}

From what I saw above I suspect there are millions of other errors in your code that you need to resolve. Didn't you compile any of that code yet ?:-O

yeah i can take out the unsed parameter, it was just for my testing... and what about the write out???

collection::~collection()
{
	
	BST tree;
	tree.~BST();
}

Remove that code (lines 4 and 5) because the BST destructor will be called when the collection class object is destroyed. Line 4 above is hiding the class object declared in the header file.

collection::collection (char * fileName,vendor & avendor)
{
	
    hash("oo.txt");  //call hash's filename constructor in hash class
	BST("oo.txt");   //call bst's filename construcor in bst class
	
}

That code is wrong too. Use the object names, not the class names, like below: But the code below is also probably wrong because it doesn't use the two parameters for anything. Maybe you are supposed to pass them on to tree and table??

collection::collection (char * fileName,vendor & avendor)
{
	
    table("oo.txt");  //call hash's filename constructor in hash class
    tree("oo.txt");   //call bst's filename construcor in bst class
	
}

From what I saw above I suspect there are millions of other errors in your code that you need to resolve. Didn't you compile any of that code yet ?:-O

void collection::writeOut(char * fileName,vendor &avendor)
{
 hash table;	
 table.writeOut(fileName,avendor);
 BST tree;
 tree.writeOut(fileName,avendor);
}

Here again you are hiding the class objects table and tree. Delete lines 3 and 5 above.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.