请解决我的问题 [英] please solve my confussion

查看:57
本文介绍了请解决我的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



大家好

i对于给定的问题有疑惑

请帮帮我

4.会发生什么使用以下程序:

void main(){

myclass * pmc = new myclass;

pmc = 0;

删除pmc;}


5.语句之间有什么区别

short * p = new short(500);



短* p =新短[500];

6.你如何释放内存:

short * p =新卖空(500);



卖空* p =新卖空[500];


7。如何从堆中分配10个指针的数组


Hi All
i have confussion regarding given problem
please help me out
4. What happens with the following program:
void main(){
myclass* pmc = new myclass;
pmc = 0;
delete pmc;}

5. What is the difference between the statements
short* p = new short(500);
And
short* p = new short[500];
6. How would you deallocate the memory for :
short* p = new short(500);
And
short* p = new short[500];

7. How is an array of 10 pointers to int allocated from heap

推荐答案

没有人知道这些东西

is there no body who know these thing


2005年10月24日22:56:19 -0700,HP <喜******** @ rediffmail.com>写道:
On 24 Oct 2005 22:56:19 -0700, "HP" <hi********@rediffmail.com> wrote:

大家好我有关于给定问题的讨论
请帮帮我

4.会发生什么使用以下程序:
void main(){
myclass * pmc = new myclass;
pmc = 0;
delete pmc;}

5 。这些陈述有什么区别
short * p = new short(500);

short * p = new short [500];

6。你将如何释放内存:
短* p =新短(500);

短* p =新短[500];

7 。如何从堆分配到int的10个指针数组

Hi All
i have confussion regarding given problem
please help me out
4. What happens with the following program:
void main(){
myclass* pmc = new myclass;
pmc = 0;
delete pmc;}

5. What is the difference between the statements
short* p = new short(500);
And
short* p = new short[500];
6. How would you deallocate the memory for :
short* p = new short(500);
And
short* p = new short[500];

7. How is an array of 10 pointers to int allocated from heap



我认为这是作业。尝试查看好书C书,即K& R,然后

尝试从中得到答案。


I think this is homework. Try looking to agood C book, i.e.K&R, and
try to work the answers from it.


HP写道:

是否有人知道这些事情

is there no body who know these thing




是的,有。

但老实说,问题是:

在另一个帖子中,你描述了你需要做什么,你的

分配要求什么。除了一两件事之外,这些任务

并不困难,我希望程序员能够轻松地编写90%的代码

。另一方面,对于非程序员而言,这项任务非常困难,而且你的问题表明,在你甚至可以考虑打电话之前,你需要学习很多东西。你自己

程序员。所以我想我们大多数人担心的只是:为你写这个申请。


否则:

自己动手一本书,开始学习基础知识。编程,特别是

C ++编程不是一天你可以学到的东西.2。在学习基础知识之前预留一些

个月,然后你就可以考虑打捞

你的任务问题。


祝你好运。


-

Karl Heinz Buchegger
kb******@gascad.at


这篇关于请解决我的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆