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

📄 subject_54423.htm

📁 vc
💻 HTM
字号:
<p>
序号:54423 发表者:丁丁当当 发表日期:2003-09-28 10:03:24
<br>主题:如何申请二维数组
<br>内容:我的程序:<BR>&nbsp;&nbsp;&nbsp;&nbsp;double **weight;<BR>&nbsp;&nbsp;&nbsp;&nbsp;*weight = new double[from][to];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 或<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; weight = new double[from][to];<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //from和to函数的两个参数<BR>编译时出现:<BR>error C2540: non-constant expression as array bound<BR>error C2440: '=' : cannot convert from 'double (*)[1]' to 'double *'<BR>Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast<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>回复者:水番 回复日期:2003-09-28 10:49:46
<br>内容:又来!!<BR>前两天刚有人问<BR><BR>首先:C++不支持二维数组,他只支持数组的数组,所以你那种写法当然有问题!解决方法请看<BR>http://www.vchelp.net/cndevforum/subject_view.asp?subject_id=54126&amp;forum_id=55
<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 + -