Thanks for the help. Also thanks for pointing out that I need a pointer to a pointer if I allocate the data.
Type: Posts; User: drunken_scot
Thanks for the help. Also thanks for pointing out that I need a pointer to a pointer if I allocate the data.
This is for the return value. The options I see are returning a pointer to the new data or passing a destination pointer to the function and assigning the data there (see original post.)
What if I am using larger structures, say 5 MB images? I clearly do not want to return that on the stack. Is there a preferred way to return the new data in that case?
Thanks for the help. Part of my question was determining a best practice. I was assuming I could not return a structure from a function. As far as asking about structures with pointers in them, I...
I will be modifying the contents of the structure. With the first function, I would create the structure and do a shallow copy, which I guess is a rather silly method. I suppose it would get much...
For a program I am working on, I need to perform some operations on vectors, such as vector addition. However, I am unsure of how best to write the functions to perform the operation. My vector is...