标题:关于动态数组到的问题
取消只看楼主
东始生
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2011-3-24
结帖率:0
已结贴  问题点数:20 回复次数:0 
关于动态数组到的问题
程序代码:
#include<iostream.h>
using namespace std;
void number(int x)
{
int*p=new int [x];
};
int main()
{
int M;
cout<<"please input array number is size: "<<endl;
cin>>M;
number(M);
cout<<"please input array number:"<<endl;
for(int i=0;i<M;i++)
{
cin>>p[i];
};
for(int i=0;i<M;i++)
{
cout<<p[i];
};
delete [] p;
}
哪位老大看看,不知哪里错了!先谢谢啦
搜索更多相关主题的帖子: 动态 
2011-06-06 10:10



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-342011-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.099531 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved