c++におけるポインタ配列ポインタnew
779 ワード
int a[10] ={0,1,2,3,4,5,6,7,8,9}; // a a[0]
int* b[3]={&a[0],&a[1],&a[2]}; // b b b[0] ( a )
int* *f[3] = {&b[0],&b[1],&b[2]}; //f[0] = &b[0] *f[0] = b[0] =&a[0] **f[0] = *b[0] = a[0]
int *c = new int[10]; // c a
int *d = new int(10); //d *d=10
int* *e;
e = new int*[10]; // e (size 10)
for (int i = 0; i < 10 ; ++i)
{
e[i] = new int[10]; //e[i] e[i]
// c
//e[i] = new int(10) // e[i]
}