In C++, we all know the array can be in the "main" scope as the local variables:
int main(){
int arr[10000]; //on the stack, size can't be very large
....
}
or out of the "main" scope as global variables:
int arr[10000000]; //on BSS, sie can be very large
int main{
....
}
but I want more for this problem.
- what is the max array size? I mean the exactly value.
- What will limit the max size, for stack, I think the answer is the stack when the thread is created. But for BSS, I really don't know what exactly it is, what will limit the size of it, and is it associated with thread(just like stack) or application(like heap)?