I know that array elements are contiguous in virtual memory for sure, but are they in terms of physical memory like this one?
#define N 100*1024*1024
int arr[N];
Please Note, Until now most of you said the answer is NO but again my main question is the one below in bold.
If not, at-least if one element was found in a page then can I suppose the whole page is filled of array elements (in other words they may not be contiguous as one in different pages but contiguous in each single page thus improving performance when reading 1 element we read a full page of nearby element ie 4096 byte instead of reading another page for next elements)?
If yes, what if I tried to allocate a big array where there is no available contiguous physical memory (which can happen a lot I believe)?
If the answer depends on programming language I'm interested in C and C++ and if it depends on the OS I'm interested in linux and it's variants like ubuntu