Why does this code crash?
Posted
by user146780
on Stack Overflow
See other posts from Stack Overflow
or by user146780
Published on 2010-05-20T19:24:54Z
Indexed on
2010/05/20
19:30 UTC
Read the original article
Hit count: 176
The following code causes a stack overflow but I don't see why...
int _tmain(int argc, _TCHAR* argv[])
{
cout << "start";
char bmp[1024][768][3];
for (int p = 0; p < 9000; ++p)
{
for(int i = 0; i < 1024; ++i)
{
for(int j = 0; j < 768; ++j)
{
bmp[i][j][0] = 20;
}
}
}
cout << "Stop";
return 0;
}
Thanks
© Stack Overflow or respective owner