comp.lang.ada
 help / color / mirror / Atom feed
From: Tom Zagotta <tzagotta@mich.com>
Subject: Re: Ada vs C++ for numeric IO (integers)
Date: 1996/07/22
Date: 1996-07-22T00:00:00+00:00	[thread overview]
Message-ID: <31F42BF0.6B62@mich.com> (raw)
In-Reply-To: nhn30scxml.fsf@paralysys


Nasser Abbasi wrote:
> 
> hi,
> 
> I was playing with integer IO to see how C++ and Ada handle it.
> I noticed couple of things, I show the Ada and the C++ examples,
> and have a question on each language.
> 

  { snip }

> --
> Nasser Abbasi. C/C++/Ada Solaris. GeneAssist - A client/server application
> for Nucleic acid and protein sequence search and analysis.
> Perkin Elmer - Applied BioSystem division. email:  nasser@apldbio.com
> MSEE(control), MSCS, MSCE, FM (Fide Chess Master).

None of the languages I've ever used have provided "bullet-proof" I/O
functions that get user input; I have always written them myself.  An example 
would be a function with the following signature:

  int ReadInteger (const char* Prompt, int Min, int Max)
  {
    // your code here
  }

This function might write out the prompt, read a number from the user, make sure
it's in range, and return the integer when a valid number is typed.

These functions are typically not provided by compiler libraries because of the
uniqueness of your combination of user interface, error handling strategy, etc.

Hope that helps!
Tom Zagotta




  reply	other threads:[~1996-07-22  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-22  0:00 Ada vs C++ for numeric IO (integers) Nasser Abbasi
1996-07-22  0:00 ` Tom Zagotta [this message]
1996-07-22  0:00   ` Robert Dewar
1996-07-23  0:00   ` Nasser Abbasi
1996-07-24  0:00 ` Keith Thompson
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox