I need help on structures. I understand a structure definition goes in the global section of the program.
such as:
struct STUDENT
{
int id;
int midterm;
int final;
}
From there I am lost. Do you need to always declare a variable of the structure and where does that go? Also what is the syntax for declaring a variable of the structure?
Other questions....
1. How do you pass parameters ( or the fields) of a structure to a function?
2. How should the function call be written and how should the function definition be written. The book I have has no examples and I have tried numerous ways and none seem to work.
3. How exactly should the prototype declarations be written.
If someone could help me out using the example STUDENT structure above it would be appreciated.
I'll even send you a Pumpkin pie for Thanksgiving.
Thanks!
such as:
struct STUDENT
{
int id;
int midterm;
int final;
}
From there I am lost. Do you need to always declare a variable of the structure and where does that go? Also what is the syntax for declaring a variable of the structure?
Other questions....
1. How do you pass parameters ( or the fields) of a structure to a function?
2. How should the function call be written and how should the function definition be written. The book I have has no examples and I have tried numerous ways and none seem to work.
3. How exactly should the prototype declarations be written.
If someone could help me out using the example STUDENT structure above it would be appreciated.
I'll even send you a Pumpkin pie for Thanksgiving.
Thanks!