Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
test22
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 {Linear poiners' structure} program test22; {pointer to variable} type PtrType=^BaseType ; BaseType=record info:integer; sled:PtrType end ; {pointer type} var p,q:PtrType;{pointer variable is static (!) variable} i:integer; begin New(p); p^.info:=1; p^.sled:=Nil ; writeln('initial value of info ',p^.info:2); for i:=2 to 3 do begin New(q); q^.info:=i ; q^.sled:=p ; p:=q ; q:=Nil ; Dispose(q); end ; writeln('consequent values of the "info" ',p^.sled^.sled^.info:2,' ',p^.sled^.info:2,' ',p^.info:2 ); Dispose(p); end.
Show compiler warnings
[
+
]
Show input
Compilation time: 0.12 sec, absolute running time: 0.16 sec, cpu time: 0.01 sec, memory peak: 5 Mb, absolute service time: 0,55 sec
edit mode
|
history
|
discussion
initial value of info 1 consequent values of the "info" 1 2 3