I have a question regarding the answer in this question, but I can not comment on it because I have less than 50 representatives.
I was interested in the answer being foo()called several times, and a static variable is assigned the same number of times. So why isn't a static variable reassigned to 10 each time?
foo()
In fact, variables staticcan get reassigned . But it cannot be redefined .
static
static . .
, .
. " " ( ).
- , static. , , C11, ยง6.2.4.
C11
2
- , . , . [....]
, , 3,
, _Thread_local, , static, . - , .
_Thread_local
, , , ( ), . .
, , , , . , , , . , , , , , .
Source: https://habr.com/ru/post/1016157/More articles:Jenkins Declarative Pipeline: How to mount a temporary volume associated with a workspace in a docker container? - dockerNode.js encodes ISO8859-1 by UTF-8 - node.jshow to access history object in new React Router v4 - javascriptCan I show a restart policy for a running Docker container? - dockerState Recovery Failure Reports (decodeObject?) - iosApple reports application crash, but I can't figure it out - iosopening angular application pages in sequence - second call to page.open not called - javascriptHow to set tab bar icon fast? - iosDo C # properties always have backstage backup fields? - c #Get Selected Swift Index Tab Controller - iosAll Articles