title: error: request for member 'data' in something not a structure or union|
body: <p>I'm trying to practice Binnary trees.
  I created a struct for node, allocated it for the root and also allocated space for the left son.
  I built a function that returnes the size of the tree but it seems there is an error while trying to initialize the left son's variables.</p>
  
  <p>the main function:</p>
  
  <pre><code>int main()
  {
  node* root = (node*) malloc(sizeof(node));//allocate space for root
  root-&gt;data = 7;
  root-&gt;left = (node*) malloc(sizeof(node));//allocate space for left son of root
  root-&gt;right = NULL;
  
  root-&gt;left.data = 8;//ERROR HERE!
  root-&gt;left.left = NULL;//ERROR HERE!
  root-&gt;left.right = NULL;//ERROR HERE!
  
  
  printf("size of tree: %d\n", sizeOfTree(root));
  return 0;
  }
  </code></pre>
  
  <p>the node struct:</p>
  
  <pre><code>typedef struct
  {
  int data;
  struct node* left;
  struct node* right;
  }node;
  </code></pre>
  
  <p>The Errors i get:</p>
  
  <pre><code>error: request for member 'data' in something not a structure or union|
  error: request for member 'left' in something not a structure or union|
  error: request for member 'right' in something not a structure or union|
  </code></pre>
  
  <p>What am i doing wrong?</p>