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

📄 动态创建二维数组??? c-c++ - c++ 语言 - 社区 community_csdn_net.htm

📁 很好的收集,看了以后都不知道说什么了. 都是关于内存调试方面的.十分有用.
💻 HTM
📖 第 1 页 / 共 2 页
字号:
      ga[i]   =   ga[i-1]+n;       
<BR>&nbsp; &nbsp; &nbsp; ... &nbsp; &nbsp; &nbsp; &nbsp; <BR>&nbsp; &nbsp; 
delete &nbsp; [] &nbsp; ga[0]; &nbsp; &nbsp; &nbsp; <BR>&nbsp; &nbsp; &nbsp; 
delete &nbsp; [] &nbsp; ga; &nbsp; <BR>&nbsp; 
缺点:程序烦琐,ga为A**类型优点:连续储存,调用直观,n可以不是已知附:1,2,3,6还有对应的malloc-free版本个人推荐1和4,2可以用4来代替,3,5调用太烦琐,毕竟源程序是拿来看的不是拿来运行的下面是一些错误和没成功的版本1. 
&nbsp; A* &nbsp; ga &nbsp; = &nbsp; new &nbsp; A[m][n]; &nbsp; &nbsp; 必然错误2. 
&nbsp; vector&lt;A[n]&gt; &nbsp; ga; &nbsp; &nbsp; &nbsp; ga.resize(m); &nbsp; 
&nbsp; &nbsp; &nbsp; <BR>&nbsp; gcc &nbsp; 3.2下编译失败,不知道其它编译器效果如何 &nbsp; &nbsp; 
&nbsp; 也不知道标准是否允许我知道的就这些,欢迎大家补充,指正 &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; <A 
href="http://www.80diy.com/home/20050215/16/3784196.html#">Top</A></P>
<H3><STRONG><A class=anchor name=r_27746698>2 楼</A>pcboyxhy(-273.15℃)<INPUT class=star2 title="二星用户 该版得分小于等于30000分,大于10000分" type=button></STRONG><SPAN>回复于 
2005-02-15 16:52:43 得分 0 </SPAN></H3>
<P>int** &nbsp; p &nbsp; = &nbsp; new[3][3]; &nbsp; //new &nbsp; 什么类型都没有说明<A 
href="http://www.80diy.com/home/20050215/16/3784196.html#">Top</A></P>
<H3><STRONG><A class=anchor name=r_27746754>3 
楼</A>lxhong1980(娶个善善良良的妻子,养个聪聪明明的孩子)<INPUT class=user1 title="一级用户 该版得分小于等于100分" type=button></STRONG><SPAN>回复于 
2005-02-15 16:57:15 得分 <EM>5</EM></SPAN></H3>
<P>建议用vector&lt;vector&lt;类型&gt; &nbsp; &gt; &nbsp; vtmp;<A 
href="http://www.80diy.com/home/20050215/16/3784196.html#">Top</A></P>
<H3><STRONG><A class=anchor name=r_27746764>4 楼</A>smartcomplier(坚强的泡沫)<INPUT class=user2 title="二级用户 该版得分小于等于500分,大于100分" type=button></STRONG><SPAN>回复于 
2005-02-15 16:58:15 得分 <EM>5</EM></SPAN></H3>
<P>你的语句本身就有错. &nbsp; <BR>&nbsp; 估计是你想这样: &nbsp; <BR>&nbsp; int**p &nbsp; =new 
&nbsp; int[3][3]; &nbsp; <BR>&nbsp; 但这样还是会有错的. &nbsp; <BR>&nbsp; 
二维数组在概念上跟指针的指针有很大的差别,因为二维数组一定要指定它维数或通过初始值能确定它的维数. &nbsp; <BR>&nbsp; 
但一维数组却不同,它在一般情况下可以当成指针用. &nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; <A 
href="http://www.80diy.com/home/20050215/16/3784196.html#">Top</A></P>
<H3><STRONG><A class=anchor name=r_27746765>5 楼</A>samuellei(决不放弃)<INPUT class=user1 title="一级用户 该版得分小于等于100分" type=button></STRONG><SPAN>回复于 
2005-02-15 16:58:20 得分 0 </SPAN></H3>
<P>int** &nbsp; p &nbsp; &nbsp; = &nbsp; new &nbsp; int[3][3];<A 
href="http://www.80diy.com/home/20050215/16/3784196.html#">Top</A></P>
<H3><STRONG><A class=anchor name=r_27746904>6 楼</A>kobefly(科比--网络学习中)<INPUT class=star2 title="二星用户 该版得分小于等于30000分,大于10000分" type=button></STRONG><SPAN>回复于 
2005-02-15 17:12:21 得分 <EM>5</EM></SPAN></H3>
<P>http://www.80diy.com/bbs/Expert/topic/3416/3416985.xml?temp=1.650637E-02 
&nbsp; <BR>&nbsp; &nbsp; <BR>&nbsp; 很不错的一个帖子<A 
href="http://www.80diy.com/home/20050215/16/3784196.html#">Top</A></P>
<H4><STRONG>相关问题</STRONG></H4>
<DIV class=relation>
<UL>
  <LI><A href="http://www.80diy.com/home/default.aspx?q=20010614/17/158817.html" 
  rel=external>怎样动态创建二维数组?</A> 
  <LI><A 
  href="http://www.80diy.com/home/default.aspx?q=20050501/20/3980033.html" 
  rel=external>怎么动态创建二维数组</A> 
  <LI><A 
  href="http://www.80diy.com/home/default.aspx?q=20050614/11/4080789.html" 
  rel=external>创建二维动态数组</A> 
  <LI><A 
  href="http://www.80diy.com/home/default.aspx?q=20060216/17/4560121.html" 
  rel=external>如何创建动态二维数组</A> 
  <LI><A 
  href="http://www.80diy.com/home/default.aspx?q=20050506/23/3986344.html" 
  rel=external>怎样创建二维动态数组(asp)</A> 
  <LI><A href="http://www.80diy.com/home/default.aspx?q=20020329/16/609318.html" 
  rel=external>动态二维数组?</A> 
  <LI><A href="http://www.80diy.com/home/default.aspx?q=20010331/16/90933.html" 
  rel=external>如何实现动态二维数组?</A> 
  <LI><A href="http://www.80diy.com/home/default.aspx?q=20010628/14/174325.html" 
  rel=external>动态结构体二维数组</A> 
  <LI><A href="http://www.80diy.com/home/default.aspx?q=20010924/16/300616.html" 
  rel=external>如何动态申请二维数组</A> 
  <LI><A 
  href="http://www.80diy.com/home/default.aspx?q=20021026/17/1127593.html" 
  rel=external>动态二维数组如何定义?</A> </LI></UL></DIV></DIV></DIV>
<DIV id=sidebar>
<H3>关键词</H3>
<DIV>
<UL>
  <LI><A href="http://tag.csdn.net/tag/.net/" rel=external>.net</A> 
  <LI><A href="http://tag.csdn.net/tag/指针/" rel=external>指针</A> 
  <LI><A href="http://tag.csdn.net/tag/二维数组/" rel=external>二维数组</A> 
  <LI><A href="http://tag.csdn.net/tag/ga/" rel=external>ga</A> 
  <LI><A href="http://tag.csdn.net/tag/维数/" rel=external>维数</A> 
  <LI><A href="http://tag.csdn.net/tag/resize/" rel=external>resize</A> 
  <LI><A href="http://tag.csdn.net/tag/知道/" rel=external>知道</A> </LI></UL></DIV>
<H3>得分解答快速导航</H3>
<DIV>
<UL>
  <LI>帖主:<A 
  href="http://www.80diy.com/home/20050215/16/3784196.html#Top">samuellei</A> 
  <LI><A 
  href="http://www.80diy.com/home/20050215/16/3784196.html#r_27746667">pcboyxhy</A> 

  <LI><A 
  href="http://www.80diy.com/home/20050215/16/3784196.html#r_27746754">lxhong1980</A> 

  <LI><A 
  href="http://www.80diy.com/home/20050215/16/3784196.html#r_27746764">smartcomplier</A> 

  <LI><A 
  href="http://www.80diy.com/home/20050215/16/3784196.html#r_27746904">kobefly</A> 
  </LI></UL></DIV>
<H3>相关链接</H3>
<DIV>
<UL>
  <LI><A href="http://blog.csdn.net/AggView/35/" target=_blank>C/C++ Blog</A> 
  <LI><A 
  href="http://www.dearbook.com.cn/Book/SearchBook.aspx?sortid=7&amp;sorttype=smallsort" 
  target=_blank>C/C++类图书</A> 
  <LI><A href="http://www.codechina.net/resource/sort.php/20" 
  target=_blank>C/C++类源码下载</A> </LI></UL></DIV>
<H3>广告也精彩</H3>
<DIV>
<SCRIPT src="动态创建二维数组??? C-C++ - C++ 语言 - 社区 community_csdn_net.files/show_ads" 
type=text/javascript></SCRIPT>
</DIV>
<H3>反馈</H3>
<DIV>请通过下述方式给我们反馈<BR><IMG alt=反馈 src=""></DIV></DIV>
<DIV class=clear></DIV></DIV>
<DIV class=-PHF id=PF>
<HR>
<A class=biaoshi 
href="http://www.hd315.gov.cn/beian/view.asp?bianhao=010202001032100010" 
rel=external>&nbsp;</A> 
<DIV><A href="http://www.csdn.net/intro/intro.asp?id=2" rel=external>网站简介</A>-<A 
href="http://www.csdn.net/intro/intro.asp?id=5" rel=external>广告服务</A>-<A 
href="http://www.csdn.net/map/map.shtm" rel=external>网站地图</A>-<A 
href="http://www.csdn.net/help/help.asp" rel=external>帮助</A>-<A 
href="http://www.csdn.net/intro/intro.asp?id=9" rel=external>联系方式</A>-<A 
href="http://job.csdn.net/Jobs/f9c75c9f2ad14404a604669b757b9ed0/viewcompany.aspx" 
rel=external>诚聘英才</A>-<A href="http://www.csdn.net/english/" 
rel=external>English</A>-<A 
href="javascript:navigate('mai'%20+%20'lto:'%20+%20'webm'%20+%20'aster@c'%20+%20'sdn.n'+'et?subject=向报告问题')" 
rel=external>问题报告</A></DIV>
<DIV>北京百联美达美数码科技有限公司&nbsp;&nbsp;版权所有&nbsp;&nbsp;京 ICP 证 020026 号</DIV>
<DIV>Copyright © 2000-2006, .NET, All Rights Reserved</DIV>
<SCRIPT 
src="动态创建二维数组??? C-C++ - C++ 语言 - 社区 community_csdn_net.files/counter.js" 
type=text/javascript></SCRIPT>

<HR>
</DIV></DIV></DIV>
<SCRIPT language=javascript 
src="动态创建二维数组??? C-C++ - C++ 语言 - 社区 community_csdn_net.files/foot_comm.js"></SCRIPT>
</BODY></HTML>

⌨️ 快捷键说明

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