> you have said in your function declaration you will pass a pointer of the SC type later on.
Thats correct.
> However if you pass &model, thats not a pointer is it?
Yes it is.
> Its just the address of the model struct variable.
Which is a pointer.
> Isnt a pointer supposed to be a memory address which contains a memory address.
A pointer is a variable which contains the address of some other variable.
Code:
SC model;
SC *ptr_to_model = &model;
datain ( &model ); // get the address of model, and pass that address to the function
datain ( ptr_to_model ); // read the contents of the variable, and pass that to the function (ie the value of &model)
Both mean and do exactly the same thing.
The advantage of the ptr_to_model method is that it allows you to dynamically create new SCs as and when you need them (pointing at an existing object doesn't add much).