In this way you can traverse to a tree in preorder. I guess this helps you on your way for a search function.
Code:
void preorder (struct btree *root)
{
if (root)
{
printf ("%d\n", root->data);
preorder (root->left);
preorder (root->right);
}
}
Extend the function in such a way that it also accepts a variable which contains the value which is searched for. Also add code for comparison and find a way to tell the calling function if the value was found or not and if it was found, find out how to let the calling function know which node contains the value.