|
|
|
|
Structure Pointers to Arguments Generally, structure pointers are used as arguments to functions rather than the structures themselves. This is done by declaring the formal argument of the function as a structure pointer. At the time of the function, a pointer to the structure or explicit address of a structure variable is passed to the functuion.This way it is the pointer that gets passed to the function at the time of invocation and not the structure itself. An advantage of this is that the elements of the structure can be modified in the function (call by reference). #include <stdio.h> |