J
Jason
Hi everyone:
I was trying to pass a pointer to a structure to a function, where the
pointer is pointing to one of the members in the structure, is this
possible???
For Example:
struct reptile *animalPtr
foo(animalPtr->snakes);
foo(animalPtr->aligator);
/* here now animalPtr->snakes == 100 and
animalPtr->aligaotr == 100 */
Within foo, I was hoping to be able to change the value of the object
in the structure.
For Example:
foo(???){ /* not sure what the parameters will be */
if(blah < blah2)
??? = 100 /* where ??? is the input to this function */
}
I was wondering would this work? If so, what would my ??? in my
example be? How would I be able to change the value of ??? ? If this
is not possible, what how should I go about doing this? Thanks in
advance for all replies.
-Jason
I was trying to pass a pointer to a structure to a function, where the
pointer is pointing to one of the members in the structure, is this
possible???
For Example:
struct reptile *animalPtr
foo(animalPtr->snakes);
foo(animalPtr->aligator);
/* here now animalPtr->snakes == 100 and
animalPtr->aligaotr == 100 */
Within foo, I was hoping to be able to change the value of the object
in the structure.
For Example:
foo(???){ /* not sure what the parameters will be */
if(blah < blah2)
??? = 100 /* where ??? is the input to this function */
}
I was wondering would this work? If so, what would my ??? in my
example be? How would I be able to change the value of ??? ? If this
is not possible, what how should I go about doing this? Thanks in
advance for all replies.
-Jason