in Education by
I'm trying to run a simulation that involves a large amount of calculations and values. I've got an issue in that large arrays cause the program to crash before it's even declared any variables. I'm not sure if this is due to my code or due to my operating system refusing to run the program. Code that crashes the program is: long double adsorption[2][4][5][10001] This array should use about 10^6 bytes, and SIZE_MAX is 10^19, so I'm confused as to why it's crashing. (Program is 64 bit in Task Manager) I'm running on Windows 7 64bit with 12 Gb of memory, of which 10 Gb is generally free. Compiler is MinGW-w64 Apologies if this is quite basic, I'm from a physics background, not coding! Cheers JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
adsorption is being allocated on the stack, and it must be overflowing the stack. Hence the error. Use malloc and family to allocate large chunks of data on the heap. edit Or make it static -- @Matt McNabb thanks! :-)

Related questions

0 votes
    I am looking for the best way to send large Numpy arrays (composed mainly of images) via Flask. ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 13, 2022 in Education by JackTerrance
0 votes
    I have written a piece of code to validate a keyword, it validates and makes sure that the word is 5 letters long and ... the problem, as it works fine without it. The code: cout...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    5. Write a program to read and store the following data in two different arrays. Using Binary Search Method search for ... 85, 72, 89 Select the correct answer from above options...
asked Dec 15, 2021 in Education by JackTerrance
0 votes
    My application crashes whenever my location is changed. Application structure is simple: there is one Activity and ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 8, 2022 in Education by JackTerrance
0 votes
    So i want to switch the elements of an array with 32 integers "n" times. All elements should be on the next position and the last ... scanf("%d", &n) != EOF) { for(int j=0; j...
asked May 27, 2022 in Education by JackTerrance
0 votes
    So i want to switch the elements of an array with 32 integers "n" times. All elements should be on the next position and the last ... scanf("%d", &n) != EOF) { for(int j=0; j...
asked May 7, 2022 in Education by JackTerrance
0 votes
    So i want to switch the elements of an array with 32 integers "n" times. All elements should be on the next position and the last ... scanf("%d", &n) != EOF) { for(int j=0; j...
asked May 4, 2022 in Education by JackTerrance
0 votes
    I would like to find out safe ways of implementing three dimensional arrays of integers in C++, using ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 31, 2022 in Education by JackTerrance
0 votes
    I would like to find out safe ways of implementing three dimensional arrays of integers in C++, using ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 30, 2022 in Education by JackTerrance
0 votes
    I would like to find out safe ways of implementing three dimensional arrays of integers in C++, using ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 29, 2022 in Education by JackTerrance
0 votes
    computer has very large…….? a. memory b.speed c. both a & b d.none of the above Select the correct answer from above options...
asked Dec 15, 2021 in Education by JackTerrance
0 votes
    perimeter of circle in c program without argument with return type Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
0 votes
    Explain call by value method with the help of a c++ program? Select the correct answer from above options...
asked Dec 14, 2021 in Education by JackTerrance
0 votes
    5. Operating System (a) links a program with the subroutines it references (b) provides a layered, user-friendly ... ) all the above Select the correct answer from above options...
asked Dec 13, 2021 in Education by JackTerrance
0 votes
    operating system is a program with subroutine it differences B provided liya user-friendly interface C enables the ... the above Select the correct answer from above options...
asked Dec 13, 2021 in Education by JackTerrance
...