#include #include #define Vacia() (Base == NULL)?TRUE:FALSE typedef enum {FALSE=0,TRUE=1} boolean; typedef int TipoDato; struct SEle{ TipoDato valor; struct SEle *sig; }; typedef struct SEle Elemento; Elemento *Base = NULL; boolean InsertarEnAnillo ( TipoDato Dato) { Elemento *paux; paux = malloc( sizeof(Elemento) ); if ( paux == NULL ) { return FALSE; } paux->valor = Dato; if ( Base == NULL ) { Base = paux; } else { paux->sig = Base->sig; } Base->sig = paux; return TRUE; } void VerAnillo ( ) { Elemento *paux; printf("\n ANILLO"); if ( !Vacia() ) { paux = Base; do { printf("->%d ",paux->valor); paux = paux->sig; } while ( paux != Base ); } } main() { InsertarEnAnillo(10); VerAnillo(); InsertarEnAnillo(11); InsertarEnAnillo(12); InsertarEnAnillo(13); VerAnillo(); getch(); }