[#BloombergLP-bdlb-NumericParseUtil-parseInt-02]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::xref:BloombergLP/bdlb/NumericParseUtil.adoc[NumericParseUtil]::parseInt
:relfileprefix: ../../../
:mrdocs:

Parse the specified `inputString` for the maximal sequence of characters forming an &lt;INT&gt; (see &lcub;Grammar Production Rules&rcub;) in the optionally specified `base` or in base 10 if `base` is not specified, and place into the specified `result` the corresponding value&period; Optionally specify `remainder`, in which to store the remainder of the `inputString` immediately following the successfully parsed text, or the position at which a parse failure was detected&period; If the parsed number is outside of the `&lsqb;INT&lowbar;MIN &period;&period; INT&lowbar;MAX&rsqb;` range the `result` will be the longest number that does not over&sol;underflow and `remainder` start at the first digit that would make the number too large&sol;small&period; Return zero on success, and a non&hyphen;zero value otherwise&period; The value of `result` is unchanged if a parse failure occurs&period; The behavior is undefined unless `2 &lt;&equals; base` and `base &lt;&equals; 36` (i&period;e&period;, bases where digits are representable by characters in the range &lsqb;`0`&hyphen;`9`&rsqb;, &lsqb;`a`&hyphen;`z`&rsqb;, or &lsqb;`A`&hyphen;`Z`&rsqb;)&period;

== Synopsis

Declared in `&lt;bdlb&lowbar;numericparseutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
parseInt(
    int* result,
    std::string&lowbar;view const& inputString,
    int base = 10);
----

== Description

A parse failure can occur for the following reasons&colon; 1&period; The `inputString` is empty&period; 2&period; The first character of `inputString` is not a valid digit in `base`, or an optional sign followed by a valid digit&period;


[.small]#Created with https://www.mrdocs.com[MrDocs]#
