Hi ![Smile](https://cboard.cprogramming.com/images/smilies/smile.png)
I was wondering if there is a way to loop over structure's components.
For example:
Code:
typedef struct myStructure myStructure;
struct myStructure {
char *name;
double len;
int n;
[etc.]
};
myStructure a,b;
in my case a is the "parent" of b.
so after assigning everything for a and copying it to b, I want to check if some of the input I have for b is different from it's parent in which case I will update b with the new input (the input for b can be incomplete (so it might have a name but not len for example) and that is why I need to copy the components of a (which is always complete) first and update only the fields that were given as input for b).
Sorry if my explenation of what I want to do is too complicated... not to sure how to write it...
in pseudo code it should be like this:
for component in b:
component=a.component
for eachComp in input:
b.component=eachComp
THANKS!!!!