I don't know how to put this in a form of a question but for example, doesn't a sample array initiation "int array[4];" hold 5 elements because the elements start from array[0]?
so the array broken down would be:
array[0] , array[1] , array[2] , array[3] , array[4], right?
if so, then why do I get a page fault error from this code?
any help is appreciated.
[code]
#include<iostream.h>
int main(void)
{
int array[4];
for(int x=0; x<=4; x++)
{
array[x] = x;
}
return 0;
}
[\code]