So, I have a structure containing two ints and want to pass the structure as a pointer (or a pointer to the structure) to a function.
So I have a few questions:
1. Do i need a pointer variable to do this? Or can i somehow just use the &-operator?
2. What if I have a struct array? E.g.:
Code:
struct myStruct{
int a;
int b;
}structArray[50];
How can i then pass the array and modify it's elements and individual members?
I would love some concrete examples and some explanation on what's going on. I might be asking for a lot but I'm really getting desperate.
I hope these questions make sense; if not, please tell me and I'll try to explain it better.
P.S I've googled and watched youtube-tutorials etc for days without luck on how to actually do this. I can only find examples that look sort of what I want to do but I really want to understand what I'm doing and not copy-paste.
Thanks in advance