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

📄 subject_14289.htm

📁 一些关于vc的问答
💻 HTM
字号:
<p>
序号:14289 发表者:lzh08 发表日期:2002-09-05 15:51:35
<br>主题:help me !!!!!!!!!!!!!!
<br>内容:#include &lt;iostream.h&gt;<BR>#include &lt;stdlib.h&gt;<BR>#include &lt;vector&gt;<BR><BR>int main(int argc, char *argv[])<BR>{<BR><BR>&nbsp;&nbsp;vector&lt;int&gt; ivec(10);<BR>&nbsp;&nbsp;int ia[10] = {0,1,2,3,4,5,6,7,8,9};<BR>&nbsp;&nbsp;for (int ix=0;ix&lt;10;ix++)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ia[ix] = ivec[ix];<BR>&nbsp;&nbsp;system("PAUSE");&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;return 0;<BR>}<BR><BR>这段程序有什么问题?为什么错误提示如下?<BR><BR>--------------------Configuration: test - Win32 Debug--------------------<BR>Compiling...<BR>test.cpp<BR>D:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\MyProjects\test\test.cpp(8) : error C2065: 'vector' : undeclared identifier<BR>D:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\MyProjects\test\test.cpp(8) : error C2062: type 'int' unexpected<BR>D:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\MyProjects\test\test.cpp(11) : error C2065: 'ivec' : undeclared identifier<BR>D:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\MyProjects\test\test.cpp(11) : error C2109: subscript requires array or pointer type<BR>Error executing cl.exe.<BR><BR>test.obj - 4 error(s), 0 warning(s)<BR>
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:天才 回复日期:2002-09-05 16:07:03
<br>内容:#include &lt;vector&gt;后面差一句 using namespace std;
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>

⌨️ 快捷键说明

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