I\'m having trouble passing an array of structs to a function in C.
I\'ve created the struct like this in main:
int main()
{
struct Items
{
Well, when you pass a structure like you did, it actually creates a local copy of it in the function. So it will have no effect on your original structure, no matter how you modify it in ReadFile
.
I am not sure about a different approach and this might not answer your question, but I recommend you try pointers. You'll definitely be using them quite a lot in C/C++. And they can be really powerful once you master them