Grazie dell ' aiuto ma per fortuna ho scovato da solo
i miei benedetti errori del codice sorgente, vi posto il tutto :
Ringrazio tutti per l ' aiuto che mi avete dato...codice:#include <stdio.h> #include <stdlib.h> #include <malloc.h> typedef struct Element { unsigned int Value; struct Element * Next; }Element; Element * Create_List ( ); void View_List ( Element * List ); int main ( ) { Element * List; List = Create_List ( ); system ( "CLS" ); View_List ( List ); system ( "PAUSE" ); return 0; } Element * Create_List ( ) { Element * Pointer, * Scroller; unsigned int Elements; printf ( "How many items you want to create ? " ); scanf ( "%u", & Elements ); if ( Elements == 0 ) Pointer = NULL; else if ( Elements > 0 ) { Pointer = ( Element * ) malloc ( sizeof (Element ) ); printf ( "Insert the value of the element : " ); scanf ( "%u", & Pointer -> Value ); Scroller = Pointer; if ( Elements > 1 ) { for ( ; ( Elements - 1 ) >= 0 ; Elements-- ) { Scroller -> Next = ( Element * ) malloc ( sizeof (Element ) ); Scroller = Scroller -> Next; printf ( "Insert the value of the element : " ); scanf ( "%u", & Scroller -> Value ); } } Scroller -> Next = NULL; } return Pointer; } void View_List ( Element * List ) { printf ( "List --->" ); while ( List != NULL ) { printf ( " %u --->", List -> Value ); } printf ( " NULL\n\n" ); }

Rispondi quotando