As far as I can see, a pointer to structure can be used. But I am wondering, is there any more efficient or elegant way to do that? At least when a structure is being used, it is not easy to see what are the parameters used by the function.
Thanks for any insightful answer.
Here’s a small example, that uses WIN32 API:
You say, that “it is not easy to see what are the parameters used by the function”. Well it depends on situation. If you don’t consider it “elegant” enough, you should leave some helpful comment there at least… if you are using good naming and trying to write code, that is self-documenting, then using of structure will be just fine.
Here’s an example of wrapping CreateThread so that programmer that uses your code doesn’t have to know that you are using some structure: