delorie.com/djgpp/doc/libc/libc_778.html | search |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
#include <inttypes.h> intmax_t strtoimax (const char *s, char **endp, int base) |
This function converts as much of s as looks like an appropriate number into the value of that number, and sets *endp to point to the first unused character.
The base argument indicates what base the digits (or letters)
should be treated as. If base is zero, the base is determined by
looking for 0x
, 0X
, or 0
as the first part of the
string, and sets the base used to 16, 16, or 8 if it finds one. The
default base is 10 if none of those prefixes are found.
The value.
ANSI/ISO C | C99; not C89 |
POSIX | 1003.1-2001; not 1003.2-1992 |
printf("Enter a number: "); fflush(stdout); gets(buf); char *bp; printf("The value is %" PRIdMAX "\n", strtoimax(buf, &bp, 0)); |
webmaster | delorie software privacy |
Copyright © 2004 | Updated Apr 2004 |