I have searched so much but yet hadn't found any good solution for c. I want to initialize an array with dynamic size. The solution I saw so far was a linked list but it seems it doesn't meet my requirements.
The code I had tested so far is as below
typedef struct
{
const unsigned char widgetCount;
unsigned char index;
lv_obj_t * radiobtnVIEW[widgetCount];
}AssetVIEW;
and then to initialize widgetCount
AssetVIEW View={4};
The error I get is
error: 'widgetCount' undeclared here (not in a function)
Your help is appreciated by this newbie.