LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

what is static variable

Dear All,
I have a very fundamental question.
If I declare a variable as follows, What it means? What the word "Static" does?
"static int panelHandle;"
Regards,
Kumar.E
0 Kudos
Message 1 of 3
(3,568 Views)

static variables are declared at compile time and survive when their block of code terminates. If declared at function level, their value survives from one call of the function to another, so that they can be used over time to store permanent values locale to the function. If declared at module level, they are common to all functions in the module and are allocated outside the stack so that their values are not lost during program life. In every case they can be accessed and modified in values by functions in the program. If arrays, they cannot be dinamically changed in size.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 3
(3,563 Views)
The static keyword can be used with a function name also, meaning the function name isn't exported to the linker, and the function is in scope only to code within the module.

Menchar
Message 3 of 3
(3,513 Views)