This isn't so much of a problem as a generalized question...
I just learned about the pointer-like nature of array structures in C; it seems to me that this relies very heavily upon the array being indexed across an unbroken band of memory for "pointer math" (i. e. int* pValue
incrementing by the value of sizeof(int)
on pValue++
) to work effectively. But it occurs to me that sometimes the OS might not be able to find a concatenated stretch of memory segments to meet the demands of the declaration, particularly for large arrays on low-performance systems.
What happens then? Does this create a runtime error or is there some sort of workaround that gets deployed?
Pleas forgive me if my code is poor... I'm still learning and C seems very important, so I'd like to get it right.