doremifasolasido
doremifasolasido

Reputation: 438

Return from function as argument

At the moment when Create returns I don't have the new error code.

typedef union {
    u8* ErrorCode_u16;
} Param;



void Create(void* params)
{
    Param *parameters = (Param*)params;

    parameters[1].ErrorCode_u16 = Foo();
}

When Create return I would like to have the new error code in my array of void pointers.

Just to mention

How can I do it ?

Upvotes: 0

Views: 77

Answers (1)

pmg
pmg

Reputation: 108988

Do it like this

Param data[2/* or more */];
Create(data);
/* data[1] has the result of Foo() call */

Upvotes: 3

Related Questions