I have a structure and a enum,
struct __value
{
int a;
enum xsd__boolean *ptr;
}
enum xsd__boolean
{
__true = 1,
__false = 0
};
Is this the right way of doing a malloc to enum and assigning the value,I want to assign the value of __true or __false to *__StructPtr->ptr
.Will the size of __true be same as that of int ?
struct __value *__StructPtr;
__StructPtr->ptr = (int *)malloc(sizeof(int));
*__StructPtr->ptr = __true;
Is this is the right way, please provide me some insight about this with some example.