PPT Slide
C.12
PASCAL
TYPE RECPOINTER = ^SPACEREC;
SPACEREC = RECORD
DATA: INTEGER;
LINK: RECPOINTER
END;
VAR HEAD, TAIL: RECPOINTER;
PROCEDURE ADD(P : RECPOINTER);
IF HEAD = NIL
THEN BEGIN
HEAD := P: TAIL := P
END
ELSE BEGIN
TAIL^.LINK := P; TAIL := P
END
END
simple syntax
user-defined types / dynamic allocation
recursion
limited I/O
no string handling, must use arrays
Previous slide
Next slide
Back to first slide
View graphic version