1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| Uses Crt;
Const BUFFER = 100;
Function Mychar (Var Arraystring : string[BUFFER]; Initpos, size: Longint):string[BUFFER] ;
Var count : Longint;
T : array[1..BUFFER] of String[1];
Begin
Mychar := '';
For count:= Initpos To Initpos+size -1 Do
Begin
T[count-Initpos + 1] := Arraystring[count];
End;
Mychar := T;
End;
Var arraychar: string[BUFFER];
Begin
Textbackground(1);
clrscr;
Textcolor(10);
writeln('Entrer une chaine de caracteres :');
Textcolor(11);
readln(arraychar);
Textcolor(10);
writeln('le deuxieme caractere est :',Mychar(arraychar,2,1));
readln;
End. |
Partager