Hey guys ive search around on previous, and found some similar post but not exactly. Im trying to pass an entire array of structs to a function. The structure is declared as a local varriable in main ( my professor has a problem with global varriables) and it needs to be pass to a function.
I was thinking something like this....
Code:
void option1(struct *data);
int main()
{
struct my_struct{
int x;
char y;
} data;
option1( data);
.
.
.
return o;
}
void option1(struct *data)
{
// function stuff
}
or do i have to pass each element of the struct by itself.
Code:
void option1( int data.x, char data.y);
thanks
chris