954,529 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?

Fill an array with one string

0
By Endre Bende on Mar 12th, 2009 2:51 pm

This little program a solution for putting a string into an array.
The method is that the string is divided for chars....
By FlamingClaw

Program StringIntoArray;

Uses Crt;
Const max = 11;
Var S:String[max];
    i:Byte;
    size:Byte;
    Ar:Array[1..max]of Char;


Begin {main}
     ClrScr;
     Write('Give me the word,max 11 char: ');
     ReadLn(S);
     size:=Length(S);
     For i:=1 To size Do
        Begin
           Ar[i]:=S[i];
           If (i = size) Then Break;
        End;

     {Now write the results}
     For i:=1 To size Do WriteLn(Ar[i]);

     ReadKey;
End. {main}
(*Created By FlamingClaw 2009.03.11*)

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You