Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 40121

declaring an array of 1000000 size

$
0
0

I was seeing a solution of a problem

in the solution an array is declared as

int vec[1000000]

when i copied the code and tried to run it on my system it gives me error but when i submitted the same code on codechef i got correct answer.

while searching for the cause i found out that i cant declare array of that size because stack memory is limited. i should declare it in heap using dynamic memory allocation but my question is that how i got correct answer on codechef ?


Viewing all articles
Browse latest Browse all 40121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>