c++ - do we have more memory space for static variables? -


int dp[2009][2009]  static int dp[2009][2009]; 

i made c++ program in declared arry as
int dp[2000][2000] program stopped working due memory allocation .when declared static
int dp[2009][2009] , program worked fine . whats reason ??

variables automatic storage can use small, implementation-dependent amount of space ("the stack"). contrast, variables static storage duration can use larger amount of space, constrained global machine constraints.

unfortunately, there no mechanism within language tell how space available automatic variables. it's implementation-dependent limit when overstep produces undefined behaviour, cannot know limit or how have left...


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -