You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
withAda.Text_IO;
-- package IO renames Ada.Text_IO; declare
Input : IO.File_Type;
begin-- Open the input file in read mode.
IO.Open (File => Input, Mode => IO.In_File, Name => "input.txt");
-- Walk through the file line by line.whilenot IO.End_Of_File (Input) loopdeclare
Line : constant String := IO.Get_Line (Input);
begin
...
end;
endloop;
-- Finally, close the file again.
IO.Close (Input);
end;
Iterating over all characters in a string
declare
Str : constant String := "Fnord";
Char : Character;
beginfor I in Str'Rangeloop
Char := Str (I);
endloop;
end;