I'm having some difficulty working with a structure. From my understanding, C++ passes structs by value to functions.
I would like to pass an struct array by reference, so I can make changes to the data inside of any of the elements of any member of the struct array.
I tried this:
[code]void my_function(some_struct *array, int some_int);[/code]
but when I try to actually call the function, like this:
I receive the error:
[code]error: cannot convert 'some_struct (*)' to 'some_struct**'[/code]
If I do not try to pass as a pointer, I can not make any changes to the data that lasts beyond leaving the my_function function.
I would prefer not to make the structure array a global element, but I can't think of any other solution.
Any advice or suggestions? Thanks in advance.