how to make function return value go to structure record
I have a question in regards to how do I make a function return value go to a specific record of a structure.
I have tried a few ways to do this but can't seem to see how to do it. Maybe i just can't see the obvious when it is in front of me :)
I now how to set records of a structure when in the main function but i have a specific return value of a function I want to set in the structure record.
as an example:
but what if I want the "Leigh" set to r->name from a seperate function?
typedef Rec *RecPointer;
r = (RecPointer)malloc(sizeof(Rec));
I know it isn't the right way but am unsure on how to proceed with this.
r->name = function()