#include <ctype.h>
int isdigit(int c);
There is a caveat on the Open Group's man page which reads as follows:
-Danny
On 30-Mar-2006, at 12:50 PM, joerg_(_at_)_britannica_(_dot_)_bec_(_dot_)_de wrote:
On Thu, Mar 30, 2006 at 02:44:19PM -0500, Daniel Ouellet wrote:What I did is to check how it was process by the macro in the /include/ctype.h:
__CTYPE_INLINE int isdigit(int c)
{
return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _N));
}
The important point is that isdigit should not be called with an argment
of type char. As I said, it works on OpenBSD. It does not work on other
systems. isdigit is a documented interface, so it should be used
correctly, since someone might want to use it on a different system
later.
Joerg