Re: count_string program
From: Cecilia Chew (cecilia_at_nowhere.com)
Date: 02/27/04
- Next message: Stephen Leake: "Re: left-to-right (was In-Out Parameters for functions)"
- Previous message: Cecilia Chew: "Re: count_string program"
- In reply to: Björn Persson: "Re: count_string program"
- Next in thread: tmoran_at_acm.org: "Re: count_string program"
- Reply: tmoran_at_acm.org: "Re: count_string program"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 27 Feb 2004 11:19:20 +0800
Björn Persson wrote:
> Cecilia Chew wrote:
>
>> Hi all,
>> I am doing a program that will count the input characters from user.
>> There is a problem that I can't solve.
>> Problem is : since I'm going to count the characters. So, I can't ask
>> user how many characters they want to input. Compilation error come
>> and mention that the string need to be constrainted.
>> How am I going to constraint the string type since I don't know how
>> many characters user going to input.
>
>
> If you do want to store the characters, and not just count them, then
> you obviously need a data type that can handle a variable number of
> characters. The first place to look for a suitable data type is Ada's
> standard library.
>
Since user will enter more than one characters, is that any problem if i
placed the type string is array (positive range <>) of character; to
handle a variable number of characters?
As input is declared as type string, isn't the characters will be stored
as the Get (input(i)); being executed??
-- Cecilia Chew c e c i l i a <AT> g r e e n l i m e . c o m
- Next message: Stephen Leake: "Re: left-to-right (was In-Out Parameters for functions)"
- Previous message: Cecilia Chew: "Re: count_string program"
- In reply to: Björn Persson: "Re: count_string program"
- Next in thread: tmoran_at_acm.org: "Re: count_string program"
- Reply: tmoran_at_acm.org: "Re: count_string program"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|