Why do undefined parameters in an if statement not cause a segfault or another error?
===

For Example:

    array[2]={1,2};
    myInt=5;

    if (array[myInt-6]==2)
       cout << true << endl;
    else
       cout << false << endl;

The referenced value in the array in the if statement is clearly out of bounds. When I compile and run this I get false outputted which makes sense as the condition is not true, but I'm wondering why theres no error outputted.