| Blessman11 (315) | |||
|
I need to create an array dynamically after reading obj coordinates from a file. The issue I'm having is that the dynamic array, needed to store my vertex group (normal position and texture coordinates), "forgets"/doesn't record the data after its leaves the function. Why wont this section be remembered when my function terminates?
| |||
|
Last edited on
|
|||
| Corpus (99) | |
|
Hi! Hint 1: When you're passing make_mesh is it the actual pointer that is passed or is a copy of it created?Hint 2: Change the argument type to mesh *& make_mesh in the argument list and try again. You should explain to yourself how and why this works, by the way!/Corpus | |
|
|
|
| ne555 (2984) | |
|
That's because you are sending a copy of the pointer. (its value) You better return the pointer (transfer ownership)... Wait, ¿why don't just return the vector? | |
|
|
|
| Blessman11 (315) | |
| @Corpus thank you 1000 times, 2 weeks error solved | |
|
|
|