What is the error in this code? Why i cant dereference the element the way I am trying it to.
#include<stdio.h>
typedef struct
{
int value;
struct node * left;
struct node * right;
} node;
int main() {
node* root,*temp;
root = (node*) malloc(sizeof(node));
root->value = 10;
(root->left)= (node*) malloc(sizeof(node));
(root->right)=(node*) malloc(sizeof(node));
((root->left)->value) =20; // WHY AN ERROR HERE???
}