Hello everyone,
I'm pretty new here.
I'm facing a problem, the compiler says "Segmentation fault".
Please take a look at the code and tell me where I'm going wrong. I tried hard to figure it out, but I couldn't.
Thanks a lot.
int **PointerArray;
*PointerArray = new int [LENGTH];
for (int cnt = HEIGHT; cnt > 0; cnt--)
PointerArray[LENGTH] = new int [HEIGHT];
for (int cnt1 = 0; cnt1 < LENGTH; cnt1++)
{
PointerArray++;
for (int cnt2 = 0; cnt2 < HEIGHT; cnt2++)
{
**PointerArray = cnt2;
*PointerArray++;
}
}
for (int cnt1 = 0; cnt1 < LENGTH; cnt1++)
{
PointerArray++;
for (int cnt2 = 0; cnt2 < HEIGHT; cnt2++)
{
cout << **PointerArray << endl;
*PointerArray++;
}
}