I have a struct in the following format
typedef struct small {
int a;
} small;
typedef struct large {
small s;
int b;
} large;
I would like to write a function which will modify the variable a
. However in the function declaration/signature I would like to have small
along the lines of
void modifyA(small* s, int newVal){
s->a = newVal;
}
I would like to keep the modifyA
function common to be supplied with both large
and small
. Is there a way to achieve this for large
as input to modifyA
function?