#include<iostream>
using namespace std;
void display(int **ptr)
{
for(int i = 0;i < 3;i++)
{
for(int j = 0;j < 5;j++)
{
cout<<ptr[i][j]<<" ";
}
cout<<endl;
}
}
int main()
{
int row = 3;
int column = 5;
int **p = new int *[row];
for(int i = 0;i<row;i++)
{
p[i] = new int[column];
for(int j = 0;j<column;j++)
{
p[i][j] = 0;
}
}
display(p);
}
C++对指针的指针和指针数组的编程
猜你喜欢
转载自blog.csdn.net/ChaoFeiLi/article/details/103674308
今日推荐
周排行