A * b=new A, [10].
for(int i=0; I & lt; 10; I++)
{
The delete & amp; B [I];
}
CodePudding user response:
B is as a whole blocks of memory management, cannot separate released one of the elementX * b=new X [n]
For (... )
{
.
}
The delete [] b;
CodePudding user response:
No problem, but the redundantA * b=new A, [10].
,,,,,,,
The delete [] b;
So you can
CodePudding user response:
Try to knowInt * b=new int [10].
//for (int I=0; I & lt; 10; I++) delete & amp; B [I];
The delete [] b;
CodePudding user response:
In the debug to run I exit the program cannot be properly I don't know what reasonCodePudding user response:
Doing so would collapse...CodePudding user response:
Int * b=new int [10].//b is a point to 10 int arrayCodePudding user response:
Int * b=new int [10].//for (int I=0; I & lt; 10; I++) delete & amp; B [I];
//choose one of these!
The delete b;
//delete [] b;
CodePudding user response:
Why do you use an array?The vector is not very good?
CodePudding user response:
The