T
Thomas Baier
Hi there,
I've written a simple tree class and want to make a function that shows a
full tree with all its nodes.
My problem is that I do not know how to get the name of an object. I'd like
to have something like
class Tree
{
char *name;
Tree() {
name = this->variable_that_contains_name_of_object;
}
}
Tree one;
cout << one.name;
that results in the output:
one
Thanks for help
Thomas
I've written a simple tree class and want to make a function that shows a
full tree with all its nodes.
My problem is that I do not know how to get the name of an object. I'd like
to have something like
class Tree
{
char *name;
Tree() {
name = this->variable_that_contains_name_of_object;
}
}
Tree one;
cout << one.name;
that results in the output:
one
Thanks for help
Thomas