Structures et fonctions
Remonter à Structures - Index
Une fonction peut renvoyer un type structure ou un pointeur sur un type structure.
mystruct func1(void); // func1() renvoie une structure
mystruct *func2(void); // func2() renvoie un pointeur sur structure
Il est possible de transmettre à une fonction une structure comme argument :
void func1(mystruct s); // directement
void func2(mystruct *sptr); // via un pointeur
void func3(mystruct &sref); // par référence (C++ seulement)