Code:
TreeNode *treesearch(TreeNode *root, char target[21])
{
TreeNode *newnode = NULL;
if(root)
{
if (strcmp(target, root->word) < 0)
{
if (root->left == NULL)
{
newnode = (TreeNode *)malloc(sizeof(TreeNode));
newnode->count = 1;
/*PROBLEM OCCURS BELOW*/
newnode->word = target;
newnode->left = NULL;
newnode->right = NULL;
root->left = newnode;
}
else
root = treesearch(root->left, target);
target is a char array and word is a char array yet GCC wont let me do it. Do i have to use strcpy? Or am i such a n00b (dont answer that just help me!)?