Home  >  Q&A  >  body text

c++ - visual studio中,查看动态二维指针数组的值。

double* p=new double[m];
for(int i=0;i<mi++){

p[i]=new double[n];

}
代码如上,我想查看整个二维数组的值。用vs自带的变量监视

黄舟黄舟2764 days ago542

reply all(1)I'll reply

  • 大家讲道理

    大家讲道理2017-04-17 13:36:52

    There is something wrong with your code.

    According to your thinking, should it be written like this?

    double** p = new double*[m];
    for (int i = 0; i < m; i++){
        p[i] = new double[n];
    }
    

    Then use

    in monitoring
    p[1][2]
    

    You can see the content this way.

    reply
    0
  • Cancelreply