Re: re echo


[ Follow Ups ] [ Post Followup ] [ The Fun with Ada Project ]

Posted by Rush on November 28, 19100 at 12:28:39:

In Reply to: re echo posted by nana on November 28, 19100 at 07:50:52:

Since "hello" is a string and a string is an
array of characters you should try
for c in reverse 1..length_of_string loop
-- your code accessing character my_string(c)
end loop;

How you get length_of_string depends on whether
"hello" was typed in the program as a string literal
e.g.,
my_string : string := "hello";
length_of_string : integer := my_string'length;
or entered using Text_Io.Get_Line(my_string, length_of_string);




Follow Ups:



Post a Followup

Name:
E-Mail:

Subject: Re: Re: re echo

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ The Fun with Ada Project ]