From: Jason M. <ko...@gm...> - 2008-08-28 19:42:46
|
On Thu, Aug 28, 2008 at 12:35 PM, Andrew Gajda <and...@gm...> wrote: > Maybe it's been a while since I've done pure C (like with my function > overloading example) but can someone tell me what the advantage might to > doing: > someGLMfunc( GLMvec3f *out, blah, blah ) > { > GLMvef3 tmp; > ... > tmp.x = something; > tmp.y = something; > tmp.z = something; > > *out = tmp; > > return out; > } > > Why not just assign *out directly? Because "out" may be equal to "blah": someFunc(GLMvec3f *out, GLMvec3f *in1, GLMvec3f *in2); GLMvec3f first, second; someFunc(&first, &first, &second); |