Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
test15
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
//fpc 3.0.4 program test15; {pointer example of circle references} type spisok=^elem; elem=record inf:real ; sled:spisok end ; var q, pervy : spisok ; mas: array[1..3] of integer ; i:integer ; procedure sostavlenie1(var p1:spisok; N:integer) ; var p:spisok ; k:integer; begin p1:=nil ; for k:=N downto 1 do begin new(p) ; p^.inf:=mas[k] ; p^.sled:=p1 ; p1:=p end end ; begin for i:=1 to 3 do mas[i]:=i ; sostavlenie1(pervy, 3) ; new(q) ; q:=pervy ; q^.sled^.sled^.sled:=q; for i:=1 to 7 do { cyclic run by circle} begin writeln(q^.inf:2:1) ; q:=q^.sled end ; dispose(q) ; end.
Show compiler warnings
[
+
]
Show input
Compilation time: 0.12 sec, absolute running time: 0.17 sec, cpu time: 0.01 sec, memory peak: 3 Mb, absolute service time: 0,44 sec
edit mode
|
history
|
discussion
1.0 2.0 3.0 1.0 2.0 3.0 1.0