Im not 100% sure about this, but:
I looked up atof in MSN Library and it looks like it can only change strings to doubles:
double atof( const char *string );
There was NOT a
float atof( const char *string);
So I assume that you will need to use a double instead of a float, OR write your own...
I'm sure you know this, and its probably correct in your actual code, but you need == instead of = in your statement if your trying to compare stuff instead of asign a value.
Okay. I think i went a bit overboard to make sure everything is deleted now, but it definately is.
My naming conventions are REALLY confusing, but here it goes. (Just remember NODE is different than node) node should have actually been named Tree because its a class that constructs and...
That definately works and keeps my program from crashing :) But does it actually delete all of the other node's when the destructor is called?
My class stores only the pointer to the root node, so all of the other stuff is hanging out there in memory once it is deleted.
Thanks for your help, it...
#include <iostream>
using namespace std;
template<typename C>
void Display(C Variable)
{
cout << C << endl;
}
int main()
{
int N = 0;
double D = 0;
Display(N);
Display(D);
return 0;
}
I didnt test this to make sure it works, but it should. I hope this helps.
Here's my code:
///////////////////////////////////////////////////////////
// Name: ~node
// Purpose: Basic Destructor; Calls DeleteTree which traverses the tree and
// deletes all of the nodes
// Recieve: NOTHING
// Return: NOTHING...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.