I get the error "incompatible types when assigning to type ‘memstruct’ from type ‘int’ " in C for the following line:

```
result1 = getValueFromBind(interpret(t->ptr1));.

```

The declarations of result1 and function are as follows:

```
memstruct result1;
memstruct getValueFromBind(memstruct bind);

```

Also, the memstruct function is defined as follows:
 typedef union Constant {
 int intval;
 char\* strval;
 }Constant;
 typedef struct memstruct{
 int type;
 Constant value;
 }memstruct;

EDIT : getValueFromBind function returns bind or NULL after a simple check.
 Interpret returns a memstruct. Also, the error is shown at the assignment in C. 

Following is Minimalist example(@gsamaras) : <http://ideone.com/Rb8ZCd>

As dsh answered it, solved the errors in my program