MFC的View类中能否声明类类型成员?
我在View类中声明了一个类类型的成员,调试时总是出现 Critical error detected c0000374 错误。具体如下:
在View中声明:Matrix mmin;
Matrix头文件:
程序代码:
class Matrix { public: int cols; int rows; int *gridData ; Matrix(); ~Matrix(); };
构造函数:
程序代码:
Matrix::Matrix() { this->rows = 15; this->cols = 10; gridData = new int[rows*cols]; for (int i = 0; i <= rows; i++) { for (int j = 0; j <= cols; j++) { gridData[i*cols + j] = 0; } } }
求大牛帮帮忙!