c - Adding another element to a structure -
i have following problem:
i want add: role structure following error codes.
error: initializer element not constant
error: (near initialization 'resource01.resource.role')
what doing wrong?
struct restresourcenode_s { restresource_t resource; struct restresourcenode_s const *next; }; struct restresourcesmanager_s { struct restresourcenode_s const * resourceslist; struct restresourcenode_s const * cursor; }; typedef struct restresourcesmanager_s restresourcesmanager_t; /* note: resource handler "/test" , "test/\*", not "/test*" */ static char const resource02url[] = "/test"; static char const resource02type[] = "type3"; static char const resource02interface[] = "if3 if4"; static int resource02role =2; static struct restresourcenode_s resource02 = { { resource02url, resource02type, resource02interface, resource02role, &resc02handler_call }, &resource01, }; /home/serval/workspace/posix/examples/restserverapp_posix/src/restapp/restresources.c:47: error: initializer element not constant /home/serval/workspace/posix/examples/restserverapp_posix/src/restapp/restresources.c:47: error: (near initialization 'resource01.resource.role')
Comments
Post a Comment