This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: atoi() check



On Wed, 28 Jan 2004, Liguo Song wrote:

> Deshpande Bansidhar(IFIN DC AI) wrote:
>
> >Hi all
> >
> >I have following code.
> >I want to add error handler for atoi() function.
> >
> >E.g.
> >
> >char *ch;
> >int num;
> >
> >/*Read ch here*/
> >
> >Num = atoi(ch);
   ^
   n
and
atoi() returns error when it fails, take the time to trap it.

HTH
-ishwar


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]