| 1234567891011121314151617 |
- program t45;
- (* readln (s[i]) : reading into one character of a string.
- s[i] is a CHAR variable, so the read must store one byte at off+i and the
- address push has to carry the subscript. Before this, the reader classified
- by the SYMBOL's class (TString) and pushed off, so readln(s[i]) read a whole
- line into s from its start instead. The two reads here land at two
- different positions, so either one being wrong changes the output. *)
- var
- s : string[10] ;
- begin
- s := 'abcde' ;
- readln (s[2]) ;
- writeln (s) ;
- readln (s[1]) ;
- writeln (s[2], s[1])
- end.
|