When I type
ulimit -s in terminal it shows
8192. Does it mean that in my C code I could only have local variable of 8192 bytes?
I am confused which stack size. Does
ulimit -s change when we modify its value?
First of all, it is 8192 kilo bytes, and not bytes. Furthermore stack is one thing, variable is another, and heap yet another. See this explanation of differences between stack and heap, for example, or this page. As far as I know stack is used for local and short lived variables, and it depends on the compiler whether stack or heap are used.
As far as I can tell, if you use
But yes, trying the following at
Here, the variable
However, if you change the ulimit (e.g.