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]

atoi() check


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);

But before calling atoi I want to make sure that ch is pointing to numberic
string. 
How should I do this. I can manually write some function to check this. But
is there
Any library function inbuilt to achieve the same ? 

Thanks & regards,
Bansidhar A. Deshpande
Software Engineer 
Infineon Technologies India Pvt. Ltd. 
Discoverer Building. 
I.T.P.L., White Field Road, 
Bangalore -560066 
Phone: +91-80-51392011   Extn : 2066
Fax: +91-80-8410012


*Disclaimer*
This e-mail and any attachments are confidential and may be subject to legal
or some other professional privilege. They are intended solely for the
attention and use of the named addressee(s). They must not be disclosed to
any person without authorization. This e-mail and any attachments are also
subject to copyright. They may only be copied or distributed with the
consent of the copyright owner. If you are not a named addressee you must
not use, disclose, retain or reproduce all or any part of the information
contained in this e-mail or any attachments. If you have received this email
by mistake please notify the sender immediately by return email and delete
or destroy all copies of the email. Any confidentiality, privilege or
copyright is not waived or lost because this email has been sent to you by
mistake.





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