I'm developing a program in C that uses an array of linked lists (a primitive hash table) as a data type to represent certain date information. The array has twelve elements corresponding to the months of the year, and each month has a linked list that contains nodes of data.
I developed the module that used this data type and it worked fine. I later discovered that I was accessing array elements that were out of bounds (for example accessing the 12th element by the index 12 instead of 11). But the program worked consistently without incident. I never received a segmentation fault. I have since corrected the coding error. Could anybody explain why accessing out-of-bounds elements would not result in a segfault?
This is not the first time it has happened. I have created a dynamically allocated multidimensional array, and for the sake of testing, I tried to access out-of-bounds elements. The program ran fine, produced accurate results, and did not seg fault in most circumstances. The only time I achieved one, I had to try accessing substantially out-of-bounds elements.
(These programs currently are windows console applications for testing. I am compiling with MinGW. I can include code, if it would be helpful.)