A function can return a structure type or a pointer to a structure type:
mystruct func1(void); // func1() returns a structure mystruct *func2(void); // func2() returns pointer to structure
A structure can be passed as an argument to a function in the following ways:
void func1(mystruct s); // directly void func2(mystruct *sptr); // via a pointer void func3(mystruct &sref); // as a reference (C++ only)
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|