cheers! I understand what you mean, thats what i was thinking myself
so.........
Code:
void saveIndexINT()
{
ofstream indexOut;
indexOut.open("indexData.txt", ios::out);
saveIndex(root, "indexData.txt");
indexOut.close();
}
void saveIndex(node *currentNode, char *filename)
{
//indexOut << numberOfRecords << endl;
if(currentNode != NULL)
{
indexOut << currentNode->name << "*" << currentNode->recNo;
saveIndex(currentNode->left, "indexData.txt");
saveIndex(currentNode->right, "indexData.txt");
}
}
I create the "indexData.txt" in the procedure before hand, I then pass it to my current procedure.
I found the code you showed me abit confusing, fwrite etc, not sure how to use those, can it be done using the read and write functions?