I hope the title did not discourage a lot of people.
So, what I am trying to do is to pass to a function the address of an array of structs, so I can later modify the items within the struct, within the array
Code:
typedef struct { //A struct of name auctionint bidder;
float bid;
} auction;
void myFunction (auction * auctionItem[]){(*aucItem[x]).bid = y;
(*aucItem[x]).bidder = z;
}
int main(){auction theItems[10];
myFunction(theItems);
}
Where x, y, and z can be any number.
When I try to run my code the IDE (I'm using Code::Blocks 12.11) does not give me any errors, but it does give me a warning:
warning: passing argument 3 of '<function name>' from incompatible pointer type [enabled by default]
and the note:
note: expected 'struct <struct name> **' but argument is of type 'struct <struct name> *'
Also, when I run the program, it will crash and return garbage.
I may be going further than my skill level, but I do not want to let this idea go yet. So thank you very much for your help.