I'd recommend against returning a structure as it would cause a rather unnecessary copy to be made(This can get quite expensive if the structure is large)(Unless C compilers are allowed/able to optimize this (Someone correct me if i'm wrong)), it would probably be better to pass a "out" frame by reference to the function and modify it in place instead and only return a error code in case the function fails for some reason.
Show differencesHistory of post edits
#1SimonForsman
Posted 04 February 2013 - 10:46 AM
I'd recommend against returning a structure as it would cause a rather unnecessary copy to be made(This can get quite expensive if the structure is large), it would probably be better to pass a "out" frame by reference to the function and modify it in place instead and only return a error code in case the function fails for some reason.