⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subject_23182.htm

📁 一些关于vc的问答
💻 HTM
字号:
<p>
序号:23182 发表者:苦闷 发表日期:2002-12-02 12:35:59
<br>主题:简单问题
<br>内容:#include &lt;iostream.h&gt;<BR>#include &lt;string.h&gt;<BR>using namespace std;<BR>void main()<BR>{<BR>string str[5];<BR>for(int i=0; i&lt;5; i++)<BR>{<BR>&nbsp;&nbsp; cin&gt;&gt;str[i];<BR>&nbsp;&nbsp; cout&lt;&lt;"str["&lt;&lt;i&lt;&lt;"]="&lt;&lt;str[i]&lt;&lt;endl;;<BR>}<BR>error C2871: 'std' : does not exist or is not a namespace<BR>error C2065: 'string' : undeclared identifier<BR>error C2146: syntax error : missing ';' before identifier 'str'<BR>error C2065: 'str' : undeclared identifier<BR>error C2109: subscript requires array or pointer type<BR>error C2109: subscript requires array or pointer type<BR>error C2679: binary '&gt;&gt;' : no operator defined which takes a right-hand operand of type 'int' (or there is no acceptable conversion)<BR>error C2109: subscript requires array or pointer type<BR>Error executing cl.exe.<BR>13.exe - 8 error(s), 0 warning(s)}<BR>还有using namespace std;是什么意思。<BR>
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:Norton AntiVirus 回复日期:2002-12-02 12:37:25
<br>内容:建议参考《Thinking in C++》这本书<BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:bird 回复日期:2002-12-02 12:46:11
<br>内容:因为string 被封在命名空间std里<BR><BR>1、<BR>#include &lt;string&gt;<BR>using namespace std ;<BR><BR>string strtemp;<BR><BR>2、<BR>#include &lt;string&gt;<BR><BR>std::string strtemp; 
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:苦闷 回复日期:2002-12-02 13:28:21
<br>内容:#include &lt;iostream&gt;<BR>#include &lt;string&gt;<BR>和<BR>#include &lt;iostream.h&gt;<BR>#include &lt;string.h&gt;什么不同的。<BR><BR>2002-12-2 13:34:02

⌨️ 快捷键说明

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