i'm using code::bocks on GNU/linux/ I know what is segmentation fault, just curious what caused it in this case. why doest it return segmentation fault:
#include <iostream>
int main()
{
using namespace std;
int tab1[3];
tab1[0] = 2 + 7 * 16 - 8;
tab1[1] = 22 * 2 / 11;
tab1[2] = 8383 - 222 + 292 * 8;
tab1[3] = 5 * 2 * 4;
cout << " " << tab1[1];
return 0;
}
and this not
#include <iostream>
int main()
{
using namespace std;
int tab1[3];
tab1[0] = 2 + 7 * 16 - 8;
tab1[1] = 22 * 2 / 11;
tab1[2] = 8383 - 222 + 292 * 8;
tab1[3] = 5 * 2 * 4;
cout << tab1[1];
return 0;
}