<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Standard C String & Character</title>
</head>
<body>
<div class="Section1" style="LAYOUT-GRID: 15.6pt none">
<table style="BACKGROUND: #eeeeff; WIDTH: 100%; mso-cellspacing: 1.5pt; mso-padding-alt: 0cm 0cm 0cm 0cm" cellPadding="0" width="100%" bgColor="#eeeeff" border="0">
<tbody>
<tr>
<td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt">
<p class="MsoNormal"><span lang="EN-US"><a href="file:///C:/Documents%20and%20Settings/ZS/桌面/index.html">cppreference.com</a>
-> <a href="file:///C:/Documents%20and%20Settings/ZS/桌面/stdstring.html">Standard
C String & Character</a> -> </span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">详解</span><span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体"><o:p>
</o:p>
</span></p>
</td>
</tr>
</tbody>
</table>
<h1>标准<span lang="EN-US">c字符和字符串</span></h1>
<div class="MsoNormal" style="TEXT-ALIGN: center" align="center">
<span lang="EN-US">
<hr align="center" width="100%" SIZE="2">
</span>
</div>
<h2><span lang="EN-US"><a name="atof">atof</a></span></h2>
<p class="MsoNormal"><i><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">语法</span><span lang="EN-US">:</span></i></p>
<table style="BACKGROUND: #ccccff; mso-cellspacing: 1.5pt; mso-padding-alt: 0cm 0cm 0cm 0cm" cellPadding="0" bgColor="#ccccff" border="0">
<tbody>
<tr>
<td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt">
<pre><span lang="EN-US"> <o:p>
</o:p>
</span></pre>
<pre><span lang="EN-US"><span style="mso-spacerun: yes"> </span>#include <stdlib.h></span></pre>
<pre><span lang="EN-US"><span style="mso-spacerun: yes"> </span>double atof( const char *str );</span></pre>
</td>
</tr>
</tbody>
</table>
<p>功能<span lang="EN-US">:将字符串<i>str</i>转换成一个双精度数值并返回结果。
参数<i>str</i> 必须以有效数字开头,但是允许以“E”或“e”除外的任意非数字字符结尾。例如:</span></p>
<pre><span lang="EN-US"><span style="mso-spacerun: yes"> </span>x = atof( "42.0is_the_answer" );</span></pre>
<p style="tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><span lang="EN-US">x的值为42.0.</span></p>
<p class="MsoNormal" style="tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><i><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">相关主题</span><span lang="EN-US">:</span></i><span lang="EN-US"><br>
<strong><a href="#atoi">atoi()</a> and <a href="#atol">atol()</a>.</strong></span></p>
<div class="MsoNormal" style="TEXT-ALIGN: center; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" align="center">
<span lang="EN-US">
<hr align="center" width="100%" SIZE="2">
</span>
</div>
<h2 style="tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><span lang="EN-US">
<a name="atoi">atoi</a></span></h2>
<p class="MsoNormal" style="tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><i><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">语法</span><span lang="EN-US">:</span></i></p>
<table style="BACKGROUND: #ccccff; mso-cellspacing: 1.5pt; mso-padding-alt: 0cm 0cm 0cm 0cm" cellPadding="0" bgColor="#ccccff" border="0">
<tbody>
<tr>
<td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt">
<pre><span lang="EN-US"> <o:p>
</o:p>
</span></pre>
<pre><span lang="EN-US"><span style="mso-spacerun: yes"> </span>#include <stdlib.h></span></pre>
<pre><span lang="EN-US"><span style="mso-spacerun: yes"> </span>int atoi( const char *str );</span></pre>
</td>
</tr>
</tbody>
</table>
<p style="tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt">功能:将字符串<i><span lang="EN-US">str</span></i>转换成一个整数并返回结果。参数<i><span lang="EN-US">str</span></i><span lang="EN-US">
以数字开头,当函数从<i>str</i>
中读到非数字字符则结束转换并将结果返回。例如,</span></p>
<pre><span lang="EN-US"><span style="mso-spacerun: yes"> </span>i = atoi( "512.035" );</span></pre>
<p style="tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><span lang="EN-US">i
的值为 512.</span></p>
<p class="MsoNormal" style="tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><i><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">相关主题</span><span lang="EN-US">:</span></i><span lang="EN-US"><br>
<strong><a href="#atof">atof()</a> and <a href="#atol">atol()</a>.</strong></span></p>
<div class="MsoNormal" style="TEXT-ALIGN: center; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt" align="center">
<span lang="EN-US">
<hr align="center" width="100%" SIZE="2">
</span>
</div>
<h2 style="tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><span lang="EN-US">
<a name="atol">atol</a></span></h2>
<p class="MsoNormal" style="tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><i><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">语法</span><span lang="EN-US">:</span></i></p>
<table style="BACKGROUND: #ccccff; mso-cellspacing: 1.5pt; mso-padding-alt: 0cm 0cm 0cm 0cm" cellPadding="0" bgColor="#ccccff" border="0">
<tbody>
<tr>
<td style="PADDING-RIGHT: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; PADDING-TOP: 0.75pt">
<pre><span lang="EN-US"> <o:p>
</o:p>
</span></pre>
<pre><span lang="EN-US"> <span style="mso-spacerun: yes"> </span>#include <stdlib.h></span></pre>
<pre><span lang="EN-US"><span style="mso-spacerun: yes"> </span>long atol( const char *str );</span></pre>
</td>
</tr>
</tbody>
</table>
<p style="tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt">功能:将字符串转换成长整型数并返回结果。函数会扫描参数<i><span lang="EN-US">str</span></i>字符串,跳过前面的空格字符,直到遇上数字或正负符号才开始做转换,而再遇到非数字或字符串结束时才结束转换,并将结果返回。例如,</p>
<pre><span lang="EN-US"><span style="mso-spacerun: yes"> </span>x = atol( "1024.0001" );</span></pre>
<p style="tab-stops: 45.8pt 91.6pt 1
没有合适的资源?快使用搜索试试~ 我知道了~
超好用的c++MSDN简化网页中文版
共70个文件
html:69个
ini:1个
5星 · 超过95%的资源 需积分: 9 533 下载量 87 浏览量
2008-11-02
00:55:53
上传
评论 11
收藏 163KB RAR 举报
温馨提示
超好用的c++MSDN简化网页中文版,希望大家支持,喜欢就顶一下
资源推荐
资源详情
资源评论
收起资源包目录
C++函数查询.rar (70个子文件)
C++函数查询
stdmem_details.html 16KB
cppio_details.html 18KB
cppstring.html 6KB
cppvector_details.html 14KB
ascii.html 11KB
iterators.html 4KB
cppset.html 11KB
cpp_stl.html 3KB
stdmem.html 8KB
cpplist_details.html 12KB
data_types.html 4KB
stdio.html 6KB
stddate_details.html 40KB
operator_precedence.html 3KB
stdio_details.html 27KB
trouble.html 2KB
complete_top.html 3KB
cppdequeue.html 5KB
cppstring_details.html 24KB
preproc.html 3KB
cppmultimap.html 4KB
cppbitset.html 3KB
cppmap_details.html 8KB
containers.html 2KB
cppmap.html 4KB
cppstack.html 3KB
cppmultimap_details.html 7KB
static_return.html 2KB
cppio_flags.html 8KB
complexity.html 3KB
cppqueue.html 2KB
all_c.html 9KB
list.html 2KB
questions.html 6KB
_desktop.ini 9B
stdother.html 14KB
cppqueue_details.html 3KB
output.html 3KB
keywords_details.html 25KB
placeholder.html 3KB
preproc_details.html 7KB
cppmultiset_details.html 32KB
cppmultiset.html 11KB
cppbitset_details.html 3KB
stdmath.html 21KB
all_cpp.html 17KB
stdother_details.html 88KB
stdmath_details.html 65KB
stddate.html 11KB
cppvector.html 5KB
stdstring.html 38KB
cppio.html 5KB
cppdequeue_details.html 9KB
cpplist.html 5KB
index.html 4KB
all.html 26KB
cpppriorityqueue.html 2KB
cppdeque.html 4KB
top.html 3KB
escape_sequences.html 3KB
links.html 2KB
cppdeque_details.html 9KB
cpppriorityqueue_details.html 3KB
credits.html 2KB
stdstring_details.html 110KB
the_rest.html 2KB
details.html 2KB
cppstack_details.html 4KB
cppset_details.html 31KB
keywords.html 10KB
共 70 条
- 1
USBserver小白
- 粉丝: 15
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
- 6
前往页