c++中双指针的初始化

双指针初始化:
字符串双指针初始化:

char **text = new char*[512];
    for (int i = 0; i < 512; i++)
    {
        text[i] = new char[1024];
    }

整型双指针初始化:

int **temp;

int i = 0;

//初始化

temp = new int*[100];

for(i = 0; i < 100; i++)

  temp[i] = new int[200];

//释放

for(i = 0; i < 100; i++)

  delete []temp[i];

delete []temp;

可以理解为temp[100][200];

猜你喜欢

转载自blog.csdn.net/u013230291/article/details/81163450