﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>IT博客-Every Day's Gain-随笔分类-C++ Programing</title><link>http://www.cnitblog.com/Larry.Zhao/category/336.html</link><description>Larry.Zhao's Coding Diary</description><language>zh-cn</language><lastBuildDate>Sat, 01 Oct 2011 04:42:33 GMT</lastBuildDate><pubDate>Sat, 01 Oct 2011 04:42:33 GMT</pubDate><ttl>60</ttl><item><title>用new给一个数组开辟空间</title><link>http://www.cnitblog.com/Larry.Zhao/archive/2005/07/13/924.html</link><dc:creator>Larry.Zhao's Coding Diary</dc:creator><author>Larry.Zhao's Coding Diary</author><pubDate>Wed, 13 Jul 2005 02:41:00 GMT</pubDate><guid>http://www.cnitblog.com/Larry.Zhao/archive/2005/07/13/924.html</guid><wfw:comment>http://www.cnitblog.com/Larry.Zhao/comments/924.html</wfw:comment><comments>http://www.cnitblog.com/Larry.Zhao/archive/2005/07/13/924.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/Larry.Zhao/comments/commentRss/924.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/Larry.Zhao/services/trackbacks/924.html</trackback:ping><description><![CDATA[很简单的问题，帮陈凯查程序的时候发现了，就记一下：<BR>Primer里面的原句贴上来吧：<BR><BR><FONT color=#ff1493><FONT style="BACKGROUND-COLOR: #ffffff" size=2>我们可以如下指定一个初始值<BR>int *pi = new int( 1024 );<BR>它不但分配了这个对象而且用1024 将其初始化<BR>要动态分配一个对象数组我们可以写成<BR>int *pia = new int[ 10 ];</FONT><BR></FONT><BR>()表示指定初值，为一个数组开辟空间还是要[]<BR><img src ="http://www.cnitblog.com/Larry.Zhao/aggbug/924.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/Larry.Zhao/" target="_blank">Larry.Zhao's Coding Diary</a> 2005-07-13 10:41 <a href="http://www.cnitblog.com/Larry.Zhao/archive/2005/07/13/924.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>