Re: n00b input help
- From: CBFalconer <cbfalconer@xxxxxxxxx>
- Date: Sat, 01 Apr 2006 06:21:40 -0500
moostafa wrote:
I'm writing a program that performs arithmetic operations on
integers. I want to be able to type in a bunch of integers
seperated by any amount of white space then terminate input with
a non-integer character. I plan to put my input into an array,
and while I have a max size I don't have a min and don't know
exactly how many arguments to expect.
I would really appreciate any ideas.
The usual solution for input of unknown length is a linked list.
Once you have determined the total input you can then use it as is,
sort it, convert it into an array, or what-not. Linked lists are
best sorted with mergesort.
--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>
.
- Follow-Ups:
- Re: n00b input help
- From: moostafa
- Re: n00b input help
- References:
- n00b input help
- From: moostafa
- n00b input help
- Prev by Date: Re: n00b input help
- Next by Date: Re: Some doubts on variable-length array
- Previous by thread: Re: n00b input help
- Next by thread: Re: n00b input help
- Index(es):
Relevant Pages
|