toxicate20 wrote:
Damn its so hard to explain what i dont understand :( |
Don't worry I think I get the gist of what you mean. :D
toxicate20 wrote:
how does th tcOne know that it in this case that it can refer to whatever cube i am taking in the opt_read_cube |
Within the scope of your function:
extern int opt_read_cube(TC_Ptr tcOne, Cube_Ptr Cube , char* acFileName)
you have provided the variable
Cube_Ptr Cube to be used within the function. (
see the second parameter in your function signature), this is why you can access it direct, in exactly the same way you can access
TC_Ptr tcOne
and
char* acFileName
, because they are within the
scope of the function.
toxicate20 wrote:
in the main() i'm only saying there is a pointer thats called Cube1 and it refers to the structure tcOne |
main() has no bearing (
from what I can see) inside this function definition. The only things that matter are the
variables declared inside the function and the
variables passed as parameters of the function.
In short,
tcOne
does not "
know" anything. The scope of the function defines what can and can't be accessed.
Here is a link that might help clarify:
http://msdn.microsoft.com/en-us/library/b7kfh662%28VS.80%29.aspx
I apologies in advance if I've not explained it well, but if your still confused please ask and I'll try to be a little more explicit.
I hope this helps!
P.S: The name is
Lnk2019, and don't worry your not the first! :)