为什么我无法从此代码中看到smartPtr2D
的输出值?
shared_ptr<shared_ptr<int[3]>[5]> smartPtr2D;
for (int i = 0; i<3; i++)
{
for (int j = 0; j<5; j++)
{
smartPtr2D[i][j] = 11;
}
}
for (int i = 0; i<3; i++)
{
for (int j = 0; j<5; j++)
{
cout << "value:" << smartPtr2D[i][j] << endl;
}
}