1<html lang="en"> 2<head> 3<title>wcstoull - Untitled</title> 4<meta http-equiv="Content-Type" content="text/html"> 5<meta name="description" content="Untitled"> 6<meta name="generator" content="makeinfo 4.13"> 7<link title="Top" rel="start" href="index.html#Top"> 8<link rel="up" href="Stdlib.html#Stdlib" title="Stdlib"> 9<link rel="prev" href="wcstoul.html#wcstoul" title="wcstoul"> 10<link rel="next" href="system.html#system" title="system"> 11<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> 12<meta http-equiv="Content-Style-Type" content="text/css"> 13<style type="text/css"><!-- 14 pre.display { font-family:inherit } 15 pre.format { font-family:inherit } 16 pre.smalldisplay { font-family:inherit; font-size:smaller } 17 pre.smallformat { font-family:inherit; font-size:smaller } 18 pre.smallexample { font-size:smaller } 19 pre.smalllisp { font-size:smaller } 20 span.sc { font-variant:small-caps } 21 span.roman { font-family:serif; font-weight:normal; } 22 span.sansserif { font-family:sans-serif; font-weight:normal; } 23--></style> 24<link rel="stylesheet" type="text/css" href="../cs.css"> 25</head> 26<body> 27<div class="node"> 28<a name="wcstoull"></a> 29<p> 30Next: <a rel="next" accesskey="n" href="system.html#system">system</a>, 31Previous: <a rel="previous" accesskey="p" href="wcstoul.html#wcstoul">wcstoul</a>, 32Up: <a rel="up" accesskey="u" href="Stdlib.html#Stdlib">Stdlib</a> 33<hr> 34</div> 35 36<h3 class="section">2.44 <code>wcstoull</code>—wide string to unsigned long long</h3> 37 38<p><a name="index-wcstoull-104"></a><a name="index-g_t_005fwcstoull_005fr-105"></a><strong>Synopsis</strong> 39<pre class="example"> #include <wchar.h> 40 unsigned long long wcstoull(const wchar_t *<var>s</var>, wchar_t **<var>ptr</var>, 41 int <var>base</var>); 42 43 unsigned long long _wcstoull_r(void *<var>reent</var>, const wchar_t *<var>s</var>, 44 wchar_t **<var>ptr</var>, int <var>base</var>); 45 46</pre> 47 <p><strong>Description</strong><br> 48The function <code>wcstoull</code> converts the wide string <code>*</code><var>s</var> to 49an <code>unsigned long long</code>. First, it breaks down the string into three parts: 50leading whitespace, which is ignored; a subject string consisting 51of the digits meaningful in the radix specified by <var>base</var> 52(for example, <code>0</code> through <code>7</code> if the value of <var>base</var> is 8); 53and a trailing portion consisting of one or more unparseable characters, 54which always includes the terminating null character. Then, it attempts 55to convert the subject string into an unsigned long long integer, and returns the 56result. 57 58 <p>If the value of <var>base</var> is zero, the subject string is expected to look 59like a normal C integer constant: an optional sign (<code>+</code> or <code>-</code>), 60a possible <code>0x</code> indicating hexadecimal radix or a possible <0> indicating 61octal radix, and a number. 62If <var>base</var> is between 2 and 36, the expected form of the subject is a 63sequence of digits (which may include letters, depending on the 64base) representing an integer in the radix specified by <var>base</var>. 65The letters <code>a</code>–<code>z</code> (or <code>A</code>–<code>Z</code>) are used as digits valued from 6610 to 35. If <var>base</var> is 16, a leading <code>0x</code> is permitted. 67 68 <p>The subject sequence is the longest initial sequence of the input 69string that has the expected form, starting with the first 70non-whitespace character. If the string is empty or consists entirely 71of whitespace, or if the first non-whitespace character is not a 72permissible digit, the subject string is empty. 73 74 <p>If the subject string is acceptable, and the value of <var>base</var> is zero, 75<code>wcstoull</code> attempts to determine the radix from the input string. A 76string with a leading <code>0x</code> is treated as a hexadecimal value; a string with 77a leading <code>0</code> and no <code>x</code> is treated as octal; all other strings are 78treated as decimal. If <var>base</var> is between 2 and 36, it is used as the 79conversion radix, as described above. Finally, a pointer to the first 80character past the converted subject string is stored in <var>ptr</var>, if 81<var>ptr</var> is not <code>NULL</code>. 82 83 <p>If the subject string is empty (that is, if <code>*</code><var>s</var> does not start 84with a substring in acceptable form), no conversion 85is performed and the value of <var>s</var> is stored in <var>ptr</var> (if <var>ptr</var> is 86not <code>NULL</code>). 87 88 <p>The alternate function <code>_wcstoull_r</code> is a reentrant version. The 89extra argument <var>reent</var> is a pointer to a reentrancy structure. 90 91 <p><br> 92<strong>Returns</strong><br> 93<code>wcstoull</code> returns <code>0</code> and sets <code>errno</code> to <code>EINVAL</code> if the value of 94<var>base</var> is not supported. 95 96 <p><code>wcstoull</code> returns the converted value, if any. If no conversion was 97made, <code>0</code> is returned. 98 99 <p><code>wcstoull</code> returns <code>ULLONG_MAX</code> if the magnitude of the converted 100value is too large, and sets <code>errno</code> to <code>ERANGE</code>. 101 102 <p><br> 103<strong>Portability</strong><br> 104<code>wcstoull</code> is ANSI. 105 106 <p><code>wcstoull</code> requires no supporting OS subroutines. 107 108 <p><br> 109 110 </body></html> 111 112