#include
# include
# include
using namespace std;
Int main ()
{
Double a1 [4]={1.1, 1.2, 1.3, 1.4};
VectorA2 (4);
A2 [0]=1.0/3;
A2 [1]=1.0/5;
A2 [3]=1.0/7;
A2 [4]=1.0/9;
ArrayArray
Cout & lt; <"A1 [2]=" & lt;Cout & lt; <"A2 [2]=" & lt; Cout & lt; <"A3 [2]=" & lt; Cout & lt; <"A4 [2]=" & lt;
return 0;
}
The results
Single-step tracking results
CodePudding user response:
I also encountered the same problem, and solveCodePudding user response:
No environment, a bit, the original poster check yourself for not1, the definition of a2 vector
2, a2 subscript, 0,1,3,4 is overrun
CodePudding user response:
VectorA2 is initialized to, 4 the default value of 0
element
A2 [4], crossing the line,,,,