这个片段工作得很好。
for (int i = 0; i < 1; i++) // for some other purpose
{
// some other code
double** angle = new double* [10]; // for a 2D matrix
for (int j = 0; j < 10; j++)
{
angle[j] = new double [3];
if (j == 0)
angle[j][0] = 2; // focused on the first column for now
else
angle[j][0] = angle[j-1][0]+3;
std::cout << angle[j][0] << std::endl;
}
for (int i = 0; i < 10; i++) …Run Code Online (Sandbox Code Playgroud)