Skip to content

Commit 13d8b4e

Browse files
author
cpprefjp-autoupdate
committed
update automatically
1 parent 71ec490 commit 13d8b4e

File tree

7 files changed

+583
-815
lines changed

7 files changed

+583
-815
lines changed

reference/chrono/make24.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ <h2>例</h2>
239239
<span class="n"><a href="../cassert/assert.html">assert</a></span><span class="p">(</span><span class="n"><span style="color:#ff0000">chrono::make24</span></span><span class="p">(</span><span class="n"><a href="duration/op_h.html">12h</a></span><span class="p">,</span> <span class="nb">false</span><span class="p">)</span> <span class="o">==</span> <span class="n"><a href="duration/op_h.html">0h</a></span><span class="p">);</span>
240240

241241
<span class="n"><a href="../cassert/assert.html">assert</a></span><span class="p">(</span><span class="n"><span style="color:#ff0000">chrono::make24</span></span><span class="p">(</span><span class="n"><a href="duration/op_h.html">12h</a></span><span class="p">,</span> <span class="nb">true</span><span class="p">)</span> <span class="o">==</span> <span class="n"><a href="duration/op_h.html">12h</a></span><span class="p">);</span>
242-
<span class="n"><a href="../cassert/assert.html">assert</a></span><span class="p">(</span><span class="n"><span style="color:#ff0000">chrono::make24</span></span><span class="p">(</span><span class="n"><a href="duration/op_h.html">1h</a></span><span class="p">,</span> <span class="nb">true</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="n"><a href="duration/op_h.html">3h</a></span><span class="p">);</span>
242+
<span class="n"><a href="../cassert/assert.html">assert</a></span><span class="p">(</span><span class="n"><span style="color:#ff0000">chrono::make24</span></span><span class="p">(</span><span class="n"><a href="duration/op_h.html">1h</a></span><span class="p">,</span> <span class="nb">true</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1L</span><span class="n">VSDyKdEczSvZknSAPEXixErhCHprMcn</span><span class="p">);</span>
243243
<span class="n"><a href="../cassert/assert.html">assert</a></span><span class="p">(</span><span class="n"><span style="color:#ff0000">chrono::make24</span></span><span class="p">(</span><span class="n"><a href="duration/op_h.html">3h</a></span><span class="p">,</span> <span class="nb">true</span><span class="p">)</span> <span class="o">==</span> <span class="n"><a href="duration/op_h.html">15h</a></span><span class="p">);</span>
244244
<span class="n"><a href="../cassert/assert.html">assert</a></span><span class="p">(</span><span class="n"><span style="color:#ff0000">chrono::make24</span></span><span class="p">(</span><span class="n"><a href="duration/op_h.html">11h</a></span><span class="p">,</span> <span class="nb">true</span><span class="p">)</span> <span class="o">==</span> <span class="n"><a href="duration/op_h.html">23h</a></span><span class="p">);</span>
245245
<span class="p">}</span>

reference/cstdlib.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@
176176

177177
<p class="text-right"><small>
178178
最終更新日時(UTC):
179-
<span itemprop="datePublished" content="2025-07-05T09:22:27">
180-
2025年07月05日 09時22分27秒
179+
<span itemprop="datePublished" content="2025-07-05T10:03:12">
180+
2025年07月05日 10時03分12秒
181181
</span>
182182
<br/>
183183
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
@@ -216,17 +216,17 @@ <h2>数値変換</h2>
216216
</thead>
217217
<tbody>
218218
<tr>
219-
<td><code>atoi</code></td>
219+
<td><code><a href="cstdlib/atoi_atol_atoll.html">atoi</a></code></td>
220220
<td>文字列を<code>int</code>型に変換する (function)</td>
221221
<td></td>
222222
</tr>
223223
<tr>
224-
<td><code>atol</code></td>
224+
<td><code><a href="cstdlib/atoi_atol_atoll.html">atol</a></code></td>
225225
<td>文字列を<code>long</code>型に変換する (function)</td>
226226
<td></td>
227227
</tr>
228228
<tr>
229-
<td><code>atoll</code></td>
229+
<td><code><a href="cstdlib/atoi_atol_atoll.html">atoll</a></code></td>
230230
<td>文字列を<code>long long</code>型に変換する (function)</td>
231231
<td>C++11</td>
232232
</tr>
Lines changed: 287 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,287 @@
1+
<!doctype html>
2+
<html class="cpprefjp" lang="ja" itemscope="" itemtype="http://schema.org/WebPage">
3+
<head>
4+
5+
6+
<!-- Google tag (gtag.js) -->
7+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-NXNBNVBTJS"></script>
8+
<script>
9+
window.dataLayer = window.dataLayer || [];
10+
function gtag(){dataLayer.push(arguments);}
11+
gtag('js', new Date());
12+
13+
gtag('config', 'G-NXNBNVBTJS');
14+
</script>
15+
16+
17+
<meta charset="UTF-8">
18+
19+
<title># atoi,atol,atoll - cpprefjp C++日本語リファレンス</title>
20+
21+
<meta name="viewport" content="width=device-width,initial-scale=1">
22+
<meta name="keywords" content="
23+
C++,標準ライブラリ,リファレンス,ドキュメント,STL,std,cstdlib,std,function
24+
">
25+
<meta name="title" content="# atoi,atol,atoll - cpprefjp C++日本語リファレンス" />
26+
<meta itemprop="name" content="# atoi,atol,atoll - cpprefjp C++日本語リファレンス" />
27+
<meta property="og:title" content="# atoi,atol,atoll - cpprefjp C++日本語リファレンス" />
28+
<meta property="og:url" content="https://cpprefjp.github.io/reference/cstdlib/atoi_atol_atoll.html" />
29+
<meta property="og:site_name" content="cpprefjp - C++日本語リファレンス" />
30+
<meta property="og:type" content="article" />
31+
<meta property="og:description" content="" />
32+
<meta name="twitter:card" content="summary" />
33+
<meta name="twitter:title" content="# atoi,atol,atoll - cpprefjp C++日本語リファレンス" />
34+
<meta name="twitter:url" content="https://cpprefjp.github.io/reference/cstdlib/atoi_atol_atoll.html" />
35+
<meta name="twitter:description" content="" />
36+
37+
38+
<link rel="alternate" type="application/atom+xml" title="Atom" href="https://cpprefjp.github.io/rss.xml" />
39+
40+
41+
<link rel="apple-touch-icon" sizes="180x180" href="../../static/favicons/apple-touch-icon.png?cachebust=77dc81f1a0fc7ba1be2bc06336653840aa3f2e20">
42+
<link rel="icon" type="image/png" sizes="32x32" href="../../static/favicons/favicon-32x32.png?cachebust=77dc81f1a0fc7ba1be2bc06336653840aa3f2e20">
43+
<link rel="icon" type="image/png" sizes="16x16" href="../../static/favicons/favicon-16x16.png?cachebust=77dc81f1a0fc7ba1be2bc06336653840aa3f2e20">
44+
<link rel="manifest" href="../../manifest.json?cachebust=77dc81f1a0fc7ba1be2bc06336653840aa3f2e20">
45+
<meta name="theme-color" content="#f5f8fc">
46+
47+
<link rel="stylesheet" href="../../static/pygments/default.css?cachebust=77dc81f1a0fc7ba1be2bc06336653840aa3f2e20">
48+
<!-- <link rel="stylesheet" href="../../static/css/root.css"> -->
49+
50+
51+
52+
53+
54+
<link href="../../static/kunai/css/kunai-stage-0.css?cachebust=77dc81f1a0fc7ba1be2bc06336653840aa3f2e20" rel="stylesheet">
55+
<link href="../../static/kunai/css/kunai-stage-1.css?cachebust=77dc81f1a0fc7ba1be2bc06336653840aa3f2e20" rel="stylesheet">
56+
<link href="../../static/kunai/css/kunai-stage-2.css?cachebust=77dc81f1a0fc7ba1be2bc06336653840aa3f2e20" rel="stylesheet">
57+
<link href="../../static/kunai/css/kunai-stage-3.css?cachebust=77dc81f1a0fc7ba1be2bc06336653840aa3f2e20" rel="stylesheet">
58+
59+
<script type="text/javascript" src="../../static/kunai/js/kunai-vendor.js?cachebust=77dc81f1a0fc7ba1be2bc06336653840aa3f2e20"></script>
60+
<script type="text/javascript" src="../../static/kunai/js/kunai.js?cachebust=77dc81f1a0fc7ba1be2bc06336653840aa3f2e20"></script>
61+
62+
<script type="text/javascript">
63+
document.addEventListener('DOMContentLoaded', function() {
64+
var kn = new Kunai;
65+
kn.cpprefjp();
66+
});
67+
</script>
68+
69+
</head>
70+
<body>
71+
<header data-kunai-mdinfo="{&#34;meta&#34;: {&#34;header&#34;: [&#34;cstdlib&#34;], &#34;namespace&#34;: [&#34;std&#34;], &#34;id-type&#34;: [&#34;function&#34;]}, &#34;sources&#34;: [{&#34;id&#34;: &#34;9ab591e74c8ad634e355e9a471b3d11d31181f2a&#34;, &#34;source&#34;: &#34;#include &lt;stdio.h&gt;\n#include &lt;stdlib.h&gt;\n\nint main(void)\n{\n printf(\&#34;%i\\n\&#34;, atoi(\&#34; -123junk\&#34;));\n printf(\&#34;%i\\n\&#34;, atoi(\&#34; +321dust\&#34;));\n printf(\&#34;%i\\n\&#34;, atoi(\&#34;0\&#34;));\n printf(\&#34;%i\\n\&#34;, atoi(\&#34;0042\&#34;)); // \u5148\u982d\u306e0\u3092\u542b\u308010\u9032\u6570\u3068\u3057\u3066\u5909\u63db\n printf(\&#34;%i\\n\&#34;, atoi(\&#34;0x2A\&#34;)); // 0\u306e\u307f\u3092\u5909\u63db\u3001\&#34;x2A\&#34;\u306f\u7834\u68c4\u3055\u308c\u308b\n printf(\&#34;%i\\n\&#34;, atoi(\&#34;junk\&#34;)); // \u5909\u63db\u4e0d\u53ef\n printf(\&#34;%i\\n\&#34;, atoi(\&#34;2147483648\&#34;)); //int\u306e\u7bc4\u56f2\u5916\n}\n&#34;}], &#34;page_id&#34;: [&#34;reference&#34;, &#34;cstdlib&#34;, &#34;atoi_atol_atoll&#34;]}">
72+
<nav class="navbar navbar-default" role="navigation">
73+
<div class="container-fluid">
74+
<div class="navbar-header">
75+
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
76+
<span class="sr-only">Toggle navigation</span>
77+
<span class="icon-bar"></span>
78+
<span class="icon-bar"></span>
79+
<span class="icon-bar"></span>
80+
</button>
81+
<a class="navbar-brand" href="../../index.html">
82+
<div class="title-wrapper clearfix">
83+
<div class="title">cpprefjp - C++日本語リファレンス</div>
84+
</div>
85+
</a>
86+
</div>
87+
88+
<div class="collapse navbar-collapse" id="navbar-collapse">
89+
<ul class="nav navbar-nav navbar-right">
90+
<li>
91+
<div class="google-search">
92+
93+
94+
<script>
95+
(function() {
96+
var cx = '013316413321391058734:ji_u66hl7hq';
97+
var gcse = document.createElement('script');
98+
gcse.type = 'text/javascript';
99+
gcse.async = true;
100+
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
101+
'//www.google.com/cse/cse.js?cx=' + cx;
102+
var s = document.getElementsByTagName('script')[0];
103+
s.parentNode.insertBefore(gcse, s);
104+
})();
105+
</script>
106+
<div class="gcse-search"></div>
107+
108+
109+
</div>
110+
</li>
111+
<li>
112+
<a href="https://github.com/cpprefjp/site">GitHub Project</a>
113+
</li>
114+
</ul>
115+
</div>
116+
</div>
117+
</nav>
118+
</header>
119+
120+
<main id="main" role="main">
121+
<div class="container-fluid">
122+
<div class="row">
123+
<div class="col-sm-9 col-sm-push-3" itemscope itemtype="http://schema.org/Article">
124+
<div class="row">
125+
<div class="col-sm-12 google-search-result">
126+
<gcse:searchresults></gcse:searchresults>
127+
</div>
128+
</div>
129+
<div class="row">
130+
<div class="col-sm-12 content-header">
131+
132+
<ol class="breadcrumb">
133+
134+
<li itemscope itemtype="http://www.schema.org/SiteNavigationElement">
135+
<span>
136+
137+
<a href="../../index.html" itemprop="url">
138+
139+
<i class="fa fa-fw fa-home"></i>
140+
141+
</a>
142+
143+
</span>
144+
</li>
145+
146+
<li itemscope itemtype="http://www.schema.org/SiteNavigationElement">
147+
<span>
148+
149+
<a href="../../reference.html" itemprop="url">
150+
151+
<span itemprop="name">リファレンス</span>
152+
153+
</a>
154+
155+
</span>
156+
</li>
157+
158+
<li itemscope itemtype="http://www.schema.org/SiteNavigationElement">
159+
<span>
160+
161+
<a href="../../reference/cstdlib.html" itemprop="url">
162+
163+
<span itemprop="name">cstdlib</span>
164+
165+
</a>
166+
167+
</span>
168+
</li>
169+
170+
<li class="active" itemscope itemtype="http://www.schema.org/SiteNavigationElement">
171+
<span>
172+
173+
174+
<span itemprop="name"># atoi,atol,atoll</span>
175+
176+
177+
</span>
178+
</li>
179+
180+
</ol>
181+
<div class="crsearch"></div>
182+
183+
</div>
184+
</div>
185+
<div class="row">
186+
<div class="col-sm-12 edit-button">
187+
188+
189+
<p class="text-right"><small>
190+
最終更新日時(UTC):
191+
<span itemprop="datePublished" content="2025-07-05T10:01:28">
192+
2025年07月05日 10時01分28秒
193+
</span>
194+
<br/>
195+
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
196+
<span itemprop="name">K10-K10</span>
197+
</span>
198+
が更新
199+
</small></p>
200+
201+
202+
<p class="text-right">
203+
<a class="history" target="_blank" href="https://github.com/cpprefjp/site/commits/master/reference/cstdlib/atoi_atol_atoll.md">
204+
<span class="fa fa-fw fa-clock-o fa-flip-horizontal"></span>履歴
205+
</a>
206+
<a class="edit" target="_blank" href="https://github.com/cpprefjp/site/edit/master/reference/cstdlib/atoi_atol_atoll.md">
207+
<span class="fa fa-fw fa-pencil"></span>編集
208+
</a>
209+
</p>
210+
</div>
211+
</div>
212+
<div class="row">
213+
<div class="col-sm-12 content-body">
214+
215+
<div class="identifier-type">function</div><div class="header">&lt;cstdlib&gt;</div><h2>atoi,atol,atoll</h2>
216+
<p><div class="codehilite"><pre><span></span><code><span class="kt">int</span> <span class="nf">atoi</span> <span class="p">(</span> <span class="k">const</span> <span class="kt">char</span><span class="o">*</span> <span class="n">str</span> <span class="p">);</span>
217+
<span class="kt">long</span> <span class="nf">atol</span> <span class="p">(</span> <span class="k">const</span> <span class="kt">char</span><span class="o">*</span> <span class="n">str</span> <span class="p">);</span>
218+
<span class="kt">long</span> <span class="kt">long</span> <span class="nf">atoll</span><span class="p">(</span> <span class="k">const</span> <span class="kt">char</span><span class="o">*</span> <span class="n">str</span> <span class="p">);</span>
219+
</code></pre></div>
220+
</p>
221+
<h2>概要</h2>
222+
<p><code>str</code><code>int long long long</code>に変換する。</p>
223+
<p>基数は常に10である。</p>
224+
<h2>変換方法</h2>
225+
<p>空白文字から始まる場合、最初の非空白文字から変換する。</p>
226+
<p>+ ,-は変換後の符号に適用される。</p>
227+
<p>変換不可能ならば0を返す.。</p>
228+
<h2>備考</h2>
229+
<p>変換後の数値が<a class="cpprefjp-defined-word" data-desc="関数呼び出し式の評価結果となるオブジェクト・値">戻り値</a>の範囲外の場合、<a class="cpprefjp-defined-word" data-desc="未定義の動作。処理系は予期せぬ動作をする可能性がある。要するに動作保証対象外。undefined behavior (UB)。" href="../../implementation-compliance.html#dfn-undefined-behavior">動作は未定義</a>である。</p>
230+
<p>名前は、ASCII to integerから命名。</p>
231+
<h2></h2>
232+
<p><div class="yata" id="9ab591e74c8ad634e355e9a471b3d11d31181f2a"><div class="codehilite"><pre><span></span><code><span class="cp">#include</span> <span class="cpf">&lt;stdio.h&gt;</span><span class="cp"></span>
233+
<span class="cp">#include</span> <span class="cpf">&lt;stdlib.h&gt;</span><span class="cp"></span>
234+
235+
<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span>
236+
<span class="p">{</span>
237+
<span class="n">printf</span><span class="p">(</span><span class="s">"%i</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">atoi</span><span class="p">(</span><span class="s">" -123junk"</span><span class="p">));</span>
238+
<span class="n">printf</span><span class="p">(</span><span class="s">"%i</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">atoi</span><span class="p">(</span><span class="s">" +321dust"</span><span class="p">));</span>
239+
<span class="n">printf</span><span class="p">(</span><span class="s">"%i</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">atoi</span><span class="p">(</span><span class="s">"0"</span><span class="p">));</span>
240+
<span class="n">printf</span><span class="p">(</span><span class="s">"%i</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">atoi</span><span class="p">(</span><span class="s">"0042"</span><span class="p">));</span> <span class="c1">// 先頭の0を含む10進数として変換</span>
241+
<span class="n">printf</span><span class="p">(</span><span class="s">"%i</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">atoi</span><span class="p">(</span><span class="s">"0x2A"</span><span class="p">));</span> <span class="c1">// 0のみを変換、"x2A"は破棄される</span>
242+
<span class="n">printf</span><span class="p">(</span><span class="s">"%i</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">atoi</span><span class="p">(</span><span class="s">"junk"</span><span class="p">));</span> <span class="c1">// 変換不可</span>
243+
<span class="n">printf</span><span class="p">(</span><span class="s">"%i</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">atoi</span><span class="p">(</span><span class="s">"2147483648"</span><span class="p">));</span> <span class="c1">//intの範囲外</span>
244+
<span class="p">}</span>
245+
</code></pre></div>
246+
</div></p>
247+
<h2>出力例</h2>
248+
<p><pre><code>-123
249+
321
250+
0
251+
42
252+
0
253+
0
254+
-2147483648
255+
</code></pre></p>
256+
<h2>参照</h2>
257+
<ul>
258+
<li><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf" target="_blank">7.22.1.2 The atoi, atol, and atoll functions</a></li>
259+
<li><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2310.pdf" target="_blank">7.22.1.2 The atoi, atol, and atoll functions (p: 249)</a></li>
260+
<li><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf" target="_blank">7.22.1.2 The atoi, atol, and atoll functions (p: 341)</a></li>
261+
<li><a href="https://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf" target="_blank">7.20.1.2 The atoi, atol, and atoll functions (p: 307)</a></li>
262+
<li><a href="https://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf" target="_blank">4.10.1.2 The atoi function</a></li>
263+
</ul><div itemprop="articleBody"></div>
264+
265+
</div>
266+
</div>
267+
</div>
268+
269+
270+
<div id="sidebar" class="col-sm-3 col-sm-pull-9">
271+
</div>
272+
273+
274+
</div>
275+
</div>
276+
</main>
277+
<footer class="footer navbar navbar-default">
278+
<div class="container-fluid">
279+
<p><small>
280+
本サイトの情報は、
281+
<a href="https://creativecommons.org/licenses/by/3.0/deed.ja" rel="nofollow">クリエイティブ・コモンズ 表示 3.0 非移植 ライセンス(CC BY)</a>
282+
の下に提供されています。
283+
</small></p>
284+
</div>
285+
</footer>
286+
</body>
287+
</html>

0 commit comments

Comments
 (0)