Hi All. I got this code. I would like to compare two strings. When the string is found, I want it to return where it found it in a Binary Tree.
My code receives a string (test) and well I get an error on the line shown.
I get a strange error here ( Unhandled exception at 0x0F3DF950 (msvcr110d.dll) in Project1.exe: 0xC0000005: Access violation reading location 0x00000000.)
Please help and another way to do this?
NodePtr find2(NodePtr root, char test)
int cmp1=strcmp((root->left)->data,test);// error code
find2(root->left,test);//transverse the tree
find2(root->right,test);//transverse the tree
return 0;// return 0 if not found