I am trying to change some variables inside a struct by using a function that returns void. The function takes a Struct member as a parameter, an array of structs and a size. The function has some code, that in the end, changes some variables inside the struct member. However, I know that when you pass something into a function as a parameter, you are working with a copy and not the original. And therefore, the changes that are made to the struct member, will not be "saved".
I have done some research on the topic, and found that pointers are one way to solve this. The problem is though, i do not know how to use pointers, and the explanations i have found are a bit confusing.
Are pointers the only way to do this? And if so, can someone explain/show me how to use the pointers in this specific situation?
Yes.
Example how to do this:
Prints:
Another example would be (taken from/based on Bruno's deleted answer):