Hi C Coders,
I have two query.
Q1)
I have two structures.
Code:
typedef struct _Object {
char objName[132];
int bit;
}Object;
typedef struct _Table {
char tableName[132];
char bit;
Object *ob;
} Table;
Table *tbl;
Table structure can contain array of structures of type Object.
I do not know the number of Table and Object structures earlier
How can I dynamically allocate the memory for these two structures, if necessary I can change the structure declaration also?
Q2) I have two structures initialized as:
Code:
Object EOBJ_ObjTable1[] = {
{"Obj1", 1111},
{"Obj2",1212},
};
Object EOBJ_ObjTable2[] = {
{"Obj1", 1213},
};
Table ETBL_Tab1 {
"Tab1", 0000, &EOBJ_ObjTable1
};
Table ETBL_Tab2 {
"Tab2", 1111, &EOBJ_ObjTable2
};
If I declare the corresponding structures as Q1), then I am getting the warning as
"Initialization makes integer from pointer without a cast"
To remove the warnings, what should be changed in the structures.
Thanks for your help in advance.
Regards,
Mayukh