Hello everyone,
I have defined a struct, and I have made an array of this struct:
I have declared the following function:Code:struct Nodes { int number; } Nodes Block[10];
Then I call it in my main() program:Code:void function_one(Nodes Block);
The following is the definition of function_one();Code:for (int i = 0; i < 10; i++) function_one(Block[i]);
The problem is that I don't know how to make the above function definition take the array element that I am sending it when I call it. For example, if in the main() part, the for loop is evaluating i = 0, I thought the definition would take i = 0 as a parameter and evaluate Block[0].number = 1.Code:void function_one(Nodes Block[]) { Block[].number = 1;
It doesn't. Any help would be appreciated.
Thanks guys!




Reply With Quote