Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
introduce character or a variable (integer or r eal) here. TYPE(Node), POINTER :: next ! pointer here. -- In a node there are two boxes. one for data (derived above) and another for pointer. END TYPE Node TYPE(Node), POINTER :: nhead, new !! Initially empty list ! this is a node consists of two boxes. open(unit=1,file='mat.inp') read(1,*)(num(i),i=1,6) write(*,*)(num(i),i=1,6) allocate (nhead) nhead%nnum=num(1) nullify(nhead%next) write(*,*)'nhead%nnum',nhead%nnum do i=2,6 allocate(new) new%nnum=num(i) new%next => nhead nhead => new write(*,*)'new%nnum',new%nnum write(*,*) enddo nullify(new) new =>nhead do i=1,6 write(*,*)'new%nnum',new%nnum new => new%Next enddo DO WHILE (ASSOCIATED(new)) PRINT *, new%nnum new => new%Next END DO stop end
ment
c c c c