example1-2.htm

来自「Visual C++面向对象程序设计教程(配套习题资源)」· HTM 代码 · 共 34 行

HTM
34
字号
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>例1-2</title>
</head>

<body>

<p><font size="2">#include   &lt;iostream.h><br> 
#include  &lt;string.h><br> 
void  main( )<br> 
{<br>
    cout &lt;&lt;"The length  of  \"this is a string\"  is :\t"<br> 
            &lt;&lt;strlen("this is a string")&lt;&lt;endl;<br> 
    cout &lt;&lt;"The size of  \"this is a string\" is :\t"<br> 
            &lt;&lt;sizeof("this is a string")&lt;&lt;endl;<br> 
}</font></p>
<font SIZE="3">
<p ALIGN="JUSTIFY"></font><font FACE="??ì?,SimSun" LANG="ZH-CN" size="2">程序输出结果是:</font></p>
<p ALIGN="JUSTIFY"><font size="2">The length of &quot;this is a string&quot; is 
: 16</font></p>
<p ALIGN="JUSTIFY"><font size="2">The size of &quot;this is a string&quot; is : 
17</font></p>
<p> </p>
<p> </p>
<p> </p>

</body>

</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?