This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Is there a better way to solve this requirement

I have a different objects, like this:

typedef struct
{
    int32_t  info ;
} item1_properties_t ;

and

typedef struct
{
    int32_t  info ;
} item2_properties_t ;

the objects are held in containers. I want to introduce a function that returns these objects (i.e. a const pointer) with minimum casts (working in C). I thought of having the function return the type and a void pointer, expecting the caller to cast correctly but I don't really like it. Do you have better ideas?

Parents
  • I don't think it is a good idea to restrict question to only address the tool chain and/or uv4.
    That will rule out many important questions concerning USB, hardware, correct programming techniques etc. True - this is a Keil forum, but this is a classical case where the sum of the parts supersedes/engulfs the whole!

Reply
  • I don't think it is a good idea to restrict question to only address the tool chain and/or uv4.
    That will rule out many important questions concerning USB, hardware, correct programming techniques etc. True - this is a Keil forum, but this is a classical case where the sum of the parts supersedes/engulfs the whole!

Children
No data