Rechercher une page de manuel
reverse
Langue: en
Version: October 1, 1997 (fedora - 05/07/09)
Section: 3 (Bibliothèques de fonctions)
NAME
reverse - reverse a list of chained elementsman2html: unable to open or read file man1/alc_origin.1
SYNOPSYS
#include "mut.h" chain_list *reverse(ptold) chain_list *ptold;
PARAMETER
- ptold
- Pointer to a chain_list to be reversed
DESCRIPTION
The reverse function allows to reverse the order of the elements of a chain_list. It means that the last element becomes the first one, the one before the last one the second one, and so on.- remark :
- all mbk structures have for first field the NEXT field, so, with appropriate cast, one can reverse any mbk list. Let's notice that nothing in the C language description demands a structure to be defined in memory the same way its members are defined in C. But all compiler do it this way now a day. Let's hope it will continue!
RETURN VALUE
reverse returns a pointer to the head of the reversed list.EXAMPLE
#include "mut.h" void reverse_con(p) lofig_list *p; { p->LOCON = (locon_list *)reverse((chain_list *)p->LOCON); }
SEE ALSO
mbk(1), chain(3).man2html: unable to open or read file man1/alc_bug_report.1
Contenus ©2006-2024 Benjamin Poulain
Design ©2006-2024 Maxime Vantorre