When the variable num
is used it I get a stack corrupted error while I'm accessing the 9th index but when I access with any other name it gives an error. Please explain me this ambiguity.
#include<iostream>
#include<iomanip>
using namespace std;
const int SIZE = 9;
class A
{
private:
int num[SIZE];
int num_2[SIZE];
public:
A()
{
for(int i = 1 ; i <= 9 ; i++)
{
num_2[i] = i;
}
}
};
void main()
{
A obj;
}