11.07.2015 Views

CrossWorks for ARM User Guide

CrossWorks for ARM User Guide

CrossWorks for ARM User Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

strtoll returns the converted value, if any. If no conversion could be per<strong>for</strong>med, zero isreturned. If the correct value is outside the range of representable values,LLONG_MIN (page 250) or LLONG_MAX (page 250) is returned according to thesign of the value, if any, and the value of the macro ERANGE is stored in errno (page247).Portabilitystrtoll con<strong>for</strong>ms to ISO/IEC 9899:1990 (C90) and ISO/IEC 9899:1999 (C99).strtoulSynopsisDescription#include unsigned long int strtoul(const char *nptr, char **endptr, int base);strtoul converts the initial portion of the string pointed to by nptr to a long intrepresentation.First, strtoul decomposes the input string into three parts: an initial, possibly empty,sequence of white-space characters (as specified by isspace (page 246)), a subjectsequence resembling an integer represented in some radix determined by the value ofbase, and a final string of one or more unrecognized characters, including theterminating null character of the input string. strtoul then attempts to convert thesubject sequence to an integer, and return the result.When converting, no integer suffix (such as U, L, UL, LL, ULL) is allowed.If the value of base is zero, the expected <strong>for</strong>m of the subject sequence is an optional plusor minus sign followed by an integer constant.If the value of base is between 2 and 36 (inclusive), the expected <strong>for</strong>m of the subjectsequence is an optional plus or minus sign followed by a sequence of letters and digitsrepresenting an integer with the radix specified by base. The letters from a (or A)through z (or Z) represent the values 10 through 35; only letters and digits whoseascribed values are less than that of base are permitted.If the value of base is 16, the characters '0x' or '0X' may optionally precede thesequence of letters and digits, following the optional sign.The subject sequence is defined as the longest initial subsequence of the input string,starting with the first non-white-space character, that is of the expected <strong>for</strong>m. Thesubject sequence contains no characters if the input string is empty or consists entirelyof white space, or if the first non-white-space character is other than a sign or apermissible letter or digit.If the subject sequence has the expected <strong>for</strong>m and the value of base is zero, thesequence of characters starting with the first digit is interpreted as an integer constant.If the subject sequence has the expected <strong>for</strong>m and the value of base is between 2 and36, it is used as the base <strong>for</strong> conversion.Chapter 28 - General utilities307

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!