in c++ I need a pointer to a pointer ?????
Ok I am not the greatest in the world at pointers.
but I can build a linked list with no problems.
New problem is this I was parsing out some xml data
and I was trying my hand at recursion.
so to make it simple I took out all the parsing and just
did a little something to try and see if it works.
I did this
struct tree
{
string data;
tree *child;
tree *sibling;
public:
tree *Root_node;
tree(){Root_node=NULL;}
tree* add_node(tree*);
};
tree* tree::add_node(tree *root)
{
int found;
char str[120];
string ReadData();
string lineinput;
static ifstream
input_line("c:\\testproject3.txt",ios::in);//input file
while (!input_line.eof())
{
found = lineinput.find("</");
tree *node = *root;
root->data = lineinput;
if (found >0)
{
root->child=add_node(root);
root->sibling=add_node(root);
return;
}
if (found <=0)
return;
}
}
=============================================
try as I might this worked but didn't.
Then I was told oh this wont work unless you use a pointer to a
pointer...something like **root.
Well I am lost and dont' know what to do this makes no since(to me)
and not sure what they are saying or how to do it.
can someone tell me what a pointer to a pointer does and if there is
something I can find to explain the syntax behind it?
thanks big time for help
Jerry